From 0fe552857468aa12097a74e08f51f5aaa983be07 Mon Sep 17 00:00:00 2001 From: Michael Foster Date: Thu, 1 Aug 2013 15:20:12 -0400 Subject: Upgrade Twig library --- inc/lib/Twig/Node/Set.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'inc/lib/Twig/Node/Set.php') 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 + * @author Fabien Potencier */ 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')); -- cgit v1.3