ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
SandboxedPrint.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of Twig.
5 *
6 * (c) Fabien Potencier
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
23{
24 public function compile(Twig_Compiler $compiler)
25 {
26 $compiler
27 ->addDebugInfo($this)
28 ->write('echo $this->env->getExtension(\'Twig_Extension_Sandbox\')->ensureToStringAllowed(')
29 ->subcompile($this->getNode('expr'))
30 ->raw(");\n")
31 ;
32 }
33
41 protected function removeNodeFilter(Twig_Node $node)
42 {
43 if ($node instanceof Twig_Node_Expression_Filter) {
44 return $this->removeNodeFilter($node->getNode('node'));
45 }
46
47 return $node;
48 }
49}
50
51class_alias('Twig_Node_SandboxedPrint', 'Twig\Node\SandboxedPrintNode', false);
An exception for terminatinating execution or to throw for unit testing.
Compiles a node to PHP code.
Definition: Compiler.php:19
addDebugInfo(Twig_NodeInterface $node)
Adds debugging information.
Definition: Compiler.php:212
Represents a node that outputs an expression.
Definition: Print.php:19
Twig_Node_SandboxedPrint adds a check for the __toString() method when the variable is an object and ...
removeNodeFilter(Twig_Node $node)
Removes node filters.
compile(Twig_Compiler $compiler)
Compiles the node to PHP.
Represents a node in the AST.
Definition: Node.php:19
getNode($name)
Definition: Node.php:186