From fb80bd53a56396d5da0c9461f93154c554638df9 Mon Sep 17 00:00:00 2001 From: uwetews Date: Thu, 17 Dec 2015 20:31:30 +0100 Subject: [PATCH] - bugfix {$smarty.capture.nameFail} did lowercase capture name https://github.com/smarty-php/smarty/issues/135 --- change_log.txt | 3 +++ libs/Smarty.class.php | 2 +- libs/sysplugins/smarty_internal_compile_capture.php | 7 +++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/change_log.txt b/change_log.txt index 84c493f1..9e9ea621 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@  ===== 3.1.29-dev ===== (xx.xx.2015) + 17.12.2015 + - bugfix {$smarty.capture.nameFail} did lowercase capture name https://github.com/smarty-php/smarty/issues/135 + 16.12.2015 - bugfix {foreach} did fail if from atrribute is a Generator class https://github.com/smarty-php/smarty/issues/128 - bugfix direct access $smarty->template_dir = 'foo'; should call Smarty::setTemplateDir() https://github.com/smarty-php/smarty/issues/121 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index d54f1b3f..eb57b94d 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/7'; + const SMARTY_VERSION = '3.1.29-dev/8'; /** * define variable scopes diff --git a/libs/sysplugins/smarty_internal_compile_capture.php b/libs/sysplugins/smarty_internal_compile_capture.php index 95c75a4b..d77f5960 100644 --- a/libs/sysplugins/smarty_internal_compile_capture.php +++ b/libs/sysplugins/smarty_internal_compile_capture.php @@ -69,10 +69,9 @@ class Smarty_Internal_Compile_Capture extends Smarty_Internal_CompileBase */ public static function compileSpecialVariable($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) { - // make all lower case - $parameter = array_map('strtolower', $parameter); - $tag = trim($parameter[0], '"\''); - if (!isset($parameter[1]) || false === $name = $compiler->getId($parameter[1])) { + $tag = strtolower(trim($parameter[ 0 ], '"\'')); + $name = isset($parameter[ 1 ]) ? $compiler->getId($parameter[ 1 ]) : false; + 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";