From e32720ef4efe9361d819268558e34d1d4029889e Mon Sep 17 00:00:00 2001 From: uwetews Date: Sat, 19 Dec 2015 19:18:31 +0100 Subject: [PATCH] - bugfix using $smarty.capture.foo in expressions could fail https://github.com/smarty-php/smarty/pull/138 --- change_log.txt | 3 +++ libs/Smarty.class.php | 2 +- libs/sysplugins/smarty_internal_compile_capture.php | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/change_log.txt b/change_log.txt index cd90bd3b..5ad5f263 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@  ===== 3.1.29-dev ===== (xx.xx.2015) + 19.12.2015 + - bugfix using $smarty.capture.foo in expressions could fail https://github.com/smarty-php/smarty/pull/138 + 18.12.2015 - bugfix regression when modifier parameter was follow by math https://github.com/smarty-php/smarty/issues/132 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 6e4fd410..2cc7ea76 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -118,7 +118,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.29-dev/11'; + const SMARTY_VERSION = '3.1.29-dev/12'; /** * define variable scopes diff --git a/libs/sysplugins/smarty_internal_compile_capture.php b/libs/sysplugins/smarty_internal_compile_capture.php index d77f5960..be45f3e9 100644 --- a/libs/sysplugins/smarty_internal_compile_capture.php +++ b/libs/sysplugins/smarty_internal_compile_capture.php @@ -74,7 +74,7 @@ class Smarty_Internal_Compile_Capture extends Smarty_Internal_CompileBase if (!$name) { $compiler->trigger_template_error("missing or illegal \$smarty.{$tag} name attribute", null, true); } - return "isset(\$_smarty_tpl->_cache['__smarty_capture']['{$name}']) ? \$_smarty_tpl->_cache['__smarty_capture']['{$name}'] : null"; + return "(isset(\$_smarty_tpl->_cache['__smarty_capture']['{$name}']) ? \$_smarty_tpl->_cache['__smarty_capture']['{$name}'] : null)"; } }