diff --git a/change_log.txt b/change_log.txt index c72abc8dc..e0df0c3d3 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 1c6eefebe..4e5ed1ee3 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 6a2ac07dd..5161da645 100644 --- a/libs/sysplugins/smarty_internal_compile_private_foreachsection.php +++ b/libs/sysplugins/smarty_internal_compile_private_foreachsection.php @@ -112,8 +112,9 @@ public function scanForProperties($attributes, Smarty_Internal_TemplateCompilerB 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;