diff --git a/change_log.txt b/change_log.txt index c72abc8d..e0df0c3d 100644 --- a/change_log.txt +++ b/change_log.txt @@ -2,6 +2,7 @@ 21.03.2018 - bugfix {$smarty.section...} used outside {section}{/section} showed incorrect values if {section}{/section} was called inside another loop https://github.com/smarty-php/smarty/issues/422 + - bugfix short form of {section} attributes did not work https://github.com/smarty-php/smarty/issues/428 17.03.2018 - improvement Smarty::compileAllTemplates() exit with a non-zero status code if max errors is reached https://github.com/smarty-php/smarty/pull/402 diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 1c6eefeb..4e5ed1ee 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.32-dev-41'; + const SMARTY_VERSION = '3.1.32-dev-42'; /** * define variable scopes */ diff --git a/libs/sysplugins/smarty_internal_compile_private_foreachsection.php b/libs/sysplugins/smarty_internal_compile_private_foreachsection.php index 6a2ac07d..5161da64 100644 --- a/libs/sysplugins/smarty_internal_compile_private_foreachsection.php +++ b/libs/sysplugins/smarty_internal_compile_private_foreachsection.php @@ -112,8 +112,9 @@ class Smarty_Internal_Compile_Private_ForeachSection extends Smarty_Internal_Com public function buildPropertyPreg($named, $attributes) { if ($named) { - $this->resultOffsets[ 'named' ] = $this->startOffset + 3; - $this->propertyPreg .= "([\$]smarty[.]{$this->tagName}[.]{$attributes['name']}[.]("; + $this->resultOffsets[ 'named' ] = $this->startOffset + 4; + $this->propertyPreg .= "(([\$]smarty[.]{$this->tagName}[.]" . ($this->tagName === 'section' ? "|[\[]\s*" : '') + . "){$attributes['name']}[.]("; $properties = $this->nameProperties; } else { $this->resultOffsets[ 'item' ] = $this->startOffset + 3;