- bugfix short form of {section} attributes did not work https://github.com/smarty-php/smarty/issues/428

This commit is contained in:
Uwe Tews
2018-03-21 15:19:57 +01:00
parent b7e7def0b1
commit d79af55485
3 changed files with 5 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
21.03.2018 21.03.2018
- bugfix {$smarty.section...} used outside {section}{/section} showed incorrect values if {section}{/section} was called inside - 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 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 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 - improvement Smarty::compileAllTemplates() exit with a non-zero status code if max errors is reached https://github.com/smarty-php/smarty/pull/402

View File

@@ -112,7 +112,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/** /**
* smarty version * smarty version
*/ */
const SMARTY_VERSION = '3.1.32-dev-41'; const SMARTY_VERSION = '3.1.32-dev-42';
/** /**
* define variable scopes * define variable scopes
*/ */

View File

@@ -112,8 +112,9 @@ class Smarty_Internal_Compile_Private_ForeachSection extends Smarty_Internal_Com
public function buildPropertyPreg($named, $attributes) public function buildPropertyPreg($named, $attributes)
{ {
if ($named) { if ($named) {
$this->resultOffsets[ 'named' ] = $this->startOffset + 3; $this->resultOffsets[ 'named' ] = $this->startOffset + 4;
$this->propertyPreg .= "([\$]smarty[.]{$this->tagName}[.]{$attributes['name']}[.]("; $this->propertyPreg .= "(([\$]smarty[.]{$this->tagName}[.]" . ($this->tagName === 'section' ? "|[\[]\s*" : '')
. "){$attributes['name']}[.](";
$properties = $this->nameProperties; $properties = $this->nameProperties;
} else { } else {
$this->resultOffsets[ 'item' ] = $this->startOffset + 3; $this->resultOffsets[ 'item' ] = $this->startOffset + 3;