12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
-
-
-
-
- class Twig_Node_SandboxedPrint extends Twig_Node_Print
- {
- public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null)
- {
- parent::__construct($expr, $lineno, $tag);
- }
-
-
-
- public function compile(Twig_Compiler $compiler)
- {
- $compiler
- ->addDebugInfo($this)
- ->write('echo $this->env->getExtension(\'sandbox\')->ensureToStringAllowed(')
- ->subcompile($this->getNode('expr'))
- ->raw(");\n")
- ;
- }
-
-
-
- protected function removeNodeFilter($node)
- {
- if ($node instanceof Twig_Node_Expression_Filter) {
- return $this->removeNodeFilter($node->getNode('node'));
- }
-
- return $node;
- }
- }
|