Twig update to latest Twig 1.x legacy as per vichan

This commit is contained in:
Benjamin Southall 2019-02-26 10:11:12 +10:00
parent 4ecd84f81d
commit e6c07544da
198 changed files with 6150 additions and 2506 deletions

View file

@ -3,7 +3,7 @@
/*
* This file is part of Twig.
*
* (c) 2010 Fabien Potencier
* (c) Fabien Potencier
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@ -21,21 +21,11 @@
*/
class Twig_Node_SandboxedPrint extends Twig_Node_Print
{
public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null)
{
parent::__construct($expr, $lineno, $tag);
}
/**
* Compiles the node to PHP.
*
* @param Twig_Compiler A Twig_Compiler instance
*/
public function compile(Twig_Compiler $compiler)
{
$compiler
->addDebugInfo($this)
->write('echo $this->env->getExtension(\'sandbox\')->ensureToStringAllowed(')
->write('echo $this->env->getExtension(\'Twig_Extension_Sandbox\')->ensureToStringAllowed(')
->subcompile($this->getNode('expr'))
->raw(");\n")
;
@ -46,9 +36,9 @@ class Twig_Node_SandboxedPrint extends Twig_Node_Print
*
* This is mostly needed when another visitor adds filters (like the escaper one).
*
* @param Twig_Node $node A Node
* @return Twig_Node
*/
protected function removeNodeFilter($node)
protected function removeNodeFilter(Twig_Node $node)
{
if ($node instanceof Twig_Node_Expression_Filter) {
return $this->removeNodeFilter($node->getNode('node'));
@ -57,3 +47,5 @@ class Twig_Node_SandboxedPrint extends Twig_Node_Print
return $node;
}
}
class_alias('Twig_Node_SandboxedPrint', 'Twig\Node\SandboxedPrintNode', false);