mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 09:44:55 +02:00
Update Twig to v2.15.4
This commit is contained in:
@@ -13,7 +13,6 @@ namespace Twig\Node;
|
||||
|
||||
use Twig\Compiler;
|
||||
use Twig\Node\Expression\ConstantExpression;
|
||||
use Twig\Node\Expression\FilterExpression;
|
||||
|
||||
/**
|
||||
* Adds a check for the __toString() method when the variable is an object and the sandbox is activated.
|
||||
@@ -42,28 +41,14 @@ class SandboxedPrintNode extends PrintNode
|
||||
;
|
||||
} else {
|
||||
$compiler
|
||||
->write('$this->env->getExtension(\'\Twig\Extension\SandboxExtension\')->ensureToStringAllowed(')
|
||||
->write('$this->extensions[SandboxExtension::class]->ensureToStringAllowed(')
|
||||
->subcompile($expr)
|
||||
->raw(");\n")
|
||||
->raw(', ')
|
||||
->repr($expr->getTemplateLine())
|
||||
->raw(", \$this->source);\n")
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes node filters.
|
||||
*
|
||||
* This is mostly needed when another visitor adds filters (like the escaper one).
|
||||
*
|
||||
* @return Node
|
||||
*/
|
||||
protected function removeNodeFilter(Node $node)
|
||||
{
|
||||
if ($node instanceof FilterExpression) {
|
||||
return $this->removeNodeFilter($node->getNode('node'));
|
||||
}
|
||||
|
||||
return $node;
|
||||
}
|
||||
}
|
||||
|
||||
class_alias('Twig\Node\SandboxedPrintNode', 'Twig_Node_SandboxedPrint');
|
||||
|
Reference in New Issue
Block a user