fixed optimizer
authorFabien Potencier <fabien.potencier@gmail.com>
Fri, 30 Sep 2011 20:49:47 +0000 (22:49 +0200)
committerFabien Potencier <fabien.potencier@gmail.com>
Fri, 30 Sep 2011 20:49:47 +0000 (22:49 +0200)
lib/Twig/NodeVisitor/Optimizer.php

index 9bb3b8f..0d0ff84 100644 (file)
@@ -94,7 +94,7 @@ class Twig_NodeVisitor_Optimizer implements Twig_NodeVisitorInterface
         if (
             $node->getNode('expr') instanceof Twig_Node_Expression_BlockReference ||
             $node->getNode('expr') instanceof Twig_Node_Expression_Parent ||
-            ($node->getNode('expr') instanceof Twig_Node_Expression_Name && !$env->hasExtension('sandbox'))
+            ($node->getNode('expr') instanceof Twig_Node_Expression_Name && !$env->hasExtension('sandbox') && !$env->isStrictVariables())
         ) {
             $node->getNode('expr')->setAttribute('output', true);