From 8e09f97a147d6c637e541f61887b1ae893763bec Mon Sep 17 00:00:00 2001 From: uwetews Date: Sun, 26 Aug 2018 00:20:31 +0200 Subject: [PATCH] - bugfix/enhancement {capture} allow variable as capture block name in Smarty special variable like $smarty.capture.$foo https://github.com/smarty-php/smarty/issues/478 https://github.com/smarty-php/smarty/pull/481 --- change_log.txt | 7 ++++++- libs/Smarty.class.php | 2 +- libs/sysplugins/smarty_internal_compile_capture.php | 7 +------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/change_log.txt b/change_log.txt index f82c9ee4..8ab5d319 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,9 @@ -===== 3.1.33-dev-6 ===== +===== 3.1.33-dev-7 ===== +26.08.2018 + - bugfix/enhancement {capture} allow variable as capture block name in Smarty special variable + like $smarty.capture.$foo https://github.com/smarty-php/smarty/issues/478 https://github.com/smarty-php/smarty/pull/481 + +===== 3.1.33-dev-6 ===== 19.08.2018 - fix PSR-2 coding standards and PHPDoc blocks https://github.com/smarty-php/smarty/pull/452 https://github.com/smarty-php/smarty/pull/475 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index a0e5fbd4..a8eb336c 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.33-dev-6'; + const SMARTY_VERSION = '3.1.33-dev-7'; /** * define variable scopes */ diff --git a/libs/sysplugins/smarty_internal_compile_capture.php b/libs/sysplugins/smarty_internal_compile_capture.php index af5bc0f1..ef0f09e4 100644 --- a/libs/sysplugins/smarty_internal_compile_capture.php +++ b/libs/sysplugins/smarty_internal_compile_capture.php @@ -43,12 +43,7 @@ class Smarty_Internal_Compile_Capture extends Smarty_Internal_CompileBase */ public static function compileSpecialVariable($args, Smarty_Internal_TemplateCompilerBase $compiler, $parameter = null) { - $tag = trim($parameter[ 0 ], '"\''); - $name = isset($parameter[ 1 ]) ? $compiler->getId($parameter[ 1 ]) : null; - if (!$name) { - //$compiler->trigger_template_error("missing or illegal \$smarty.{$tag} name attribute", null, true); - } - return '$_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl'.(isset($name)?", '{$name}')":')'); + return '$_smarty_tpl->smarty->ext->_capture->getBuffer($_smarty_tpl'.(isset($parameter[ 1 ])?", {$parameter[ 1 ]})":')'); } /**