added template line number to sandbox security check calls

This commit is contained in:
Fabien Potencier
2019-04-17 08:53:56 +02:00
parent f37212b022
commit 96e2432d1f
4 changed files with 14 additions and 6 deletions
+4 -1
View File
@@ -33,9 +33,12 @@ class CheckToStringNode extends AbstractExpression
public function compile(Compiler $compiler)
{
$expr = $this->getNode('expr');
$compiler
->raw('$this->sandbox->ensureToStringAllowed(')
->subcompile($this->getNode('expr'))
->subcompile($expr)
->raw(', ')
->repr($expr->getTemplateLine())
->raw(', $this->source)')
;
}