Skip to content

Commit

Permalink
- bugfix short form of {section} attributes did not work #428
Browse files Browse the repository at this point in the history
  • Loading branch information
Uwe Tews committed Mar 21, 2018
1 parent b7e7def commit d79af55
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion libs/Smarty.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d79af55

Please sign in to comment.