Skip to content

Commit

Permalink
- bugfix {$smarty.section...} used outside {section}{/section} showed…
Browse files Browse the repository at this point in the history
… incorrect values if {section}{/section} was called inside

   another loop smarty-php#422
  • Loading branch information
Uwe Tews committed Mar 21, 2018
1 parent 60415e6 commit b7e7def
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 4 additions & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
===== 3.1.32 - dev ===
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

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-40';
const SMARTY_VERSION = '3.1.32-dev-41';
/**
* define variable scopes
*/
Expand Down
6 changes: 1 addition & 5 deletions libs/sysplugins/smarty_internal_compile_section.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,7 @@ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
// maybe nocache because of nocache variables
$compiler->nocache = $compiler->nocache | $compiler->tag_nocache;

$initLocal =
array('saved' => "isset(\$_smarty_tpl->tpl_vars['__smarty_section_{$attributes['name']}']) ? \$_smarty_tpl->tpl_vars['__smarty_section_{$attributes['name']}'] : false",);
$initLocal = array();
$initNamedProperty = array();
$initFor = array();
$incFor = array();
Expand Down Expand Up @@ -455,9 +454,6 @@ public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
} else {
$output .= "}\n}\n";
}
$output .= "if ({$local}saved) {\n";
$output .= "{$sectionVar} = {$local}saved;\n";
$output .= "}\n";
$output .= '?>';

return $output;
Expand Down

0 comments on commit b7e7def

Please sign in to comment.