diff options
| author | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-01 15:20:12 -0400 |
|---|---|---|
| committer | Michael Foster <savetheinternet@tinyboard.org> | 2013-08-01 15:20:12 -0400 |
| commit | 0fe552857468aa12097a74e08f51f5aaa983be07 (patch) | |
| tree | 22dbca1be90d7086b20a077752552296abf23325 /inc/lib/Twig/Node/Set.php | |
| parent | 22f3a95e0e421de05a11633eac846df96a2a4768 (diff) | |
Upgrade Twig library
Diffstat (limited to 'inc/lib/Twig/Node/Set.php')
| -rw-r--r-- | inc/lib/Twig/Node/Set.php | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/inc/lib/Twig/Node/Set.php b/inc/lib/Twig/Node/Set.php index 9913664f..4c9c16ce 100644 --- a/inc/lib/Twig/Node/Set.php +++ b/inc/lib/Twig/Node/Set.php @@ -12,8 +12,7 @@ /** * Represents a set node. * - * @package twig - * @author Fabien Potencier <fabien@symfony.com> + * @author Fabien Potencier <fabien@symfony.com> */ class Twig_Node_Set extends Twig_Node { @@ -67,7 +66,7 @@ class Twig_Node_Set extends Twig_Node $compiler->subcompile($this->getNode('names'), false); if ($this->getAttribute('capture')) { - $compiler->raw(" = new Twig_Markup(ob_get_clean())"); + $compiler->raw(" = ('' === \$tmp = ob_get_clean()) ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset())"); } } @@ -87,9 +86,9 @@ class Twig_Node_Set extends Twig_Node } else { if ($this->getAttribute('safe')) { $compiler - ->raw("new Twig_Markup(") + ->raw("('' === \$tmp = ") ->subcompile($this->getNode('values')) - ->raw(")") + ->raw(") ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset())") ; } else { $compiler->subcompile($this->getNode('values')); |
