- bugfix {$smarty.capture.nameFail} did lowercase capture name https://github.com/smarty-php/smarty/issues/135

This commit is contained in:
uwetews
2015-12-17 20:31:30 +01:00
parent b7118b6beb
commit fb80bd53a5
3 changed files with 7 additions and 5 deletions

View File

@@ -1,4 +1,7 @@
 ===== 3.1.29-dev ===== (xx.xx.2015)  ===== 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 16.12.2015
- bugfix {foreach} did fail if from atrribute is a Generator class https://github.com/smarty-php/smarty/issues/128 - 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 - bugfix direct access $smarty->template_dir = 'foo'; should call Smarty::setTemplateDir() https://github.com/smarty-php/smarty/issues/121

View File

@@ -118,7 +118,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/** /**
* smarty version * smarty version
*/ */
const SMARTY_VERSION = '3.1.29-dev/7'; const SMARTY_VERSION = '3.1.29-dev/8';
/** /**
* define variable scopes * define variable scopes

View File

@@ -69,10 +69,9 @@ class Smarty_Internal_Compile_Capture extends Smarty_Internal_CompileBase
*/ */
public static function compileSpecialVariable($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter) public static function compileSpecialVariable($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter)
{ {
// make all lower case $tag = strtolower(trim($parameter[ 0 ], '"\''));
$parameter = array_map('strtolower', $parameter); $name = isset($parameter[ 1 ]) ? $compiler->getId($parameter[ 1 ]) : false;
$tag = trim($parameter[0], '"\''); if (!$name) {
if (!isset($parameter[1]) || false === $name = $compiler->getId($parameter[1])) {
$compiler->trigger_template_error("missing or illegal \$smarty.{$tag} name attribute", null, true); $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";