Skip to content

Commit

Permalink
- bugfix {$smarty.capture.nameFail} did lowercase capture name #135
Browse files Browse the repository at this point in the history
  • Loading branch information
uwetews committed Dec 17, 2015
1 parent b7118b6 commit fb80bd5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
3 changes: 3 additions & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion libs/Smarty.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 3 additions & 4 deletions libs/sysplugins/smarty_internal_compile_capture.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,9 @@ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
*/
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";
Expand Down

0 comments on commit fb80bd5

Please sign in to comment.