- 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
This commit is contained in:
Uwe Tews
2018-03-21 07:36:11 +01:00
parent 60415e6f2a
commit b7e7def0b1
3 changed files with 6 additions and 6 deletions

View File

@@ -1,4 +1,8 @@
===== 3.1.32 - dev === ===== 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 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-40'; const SMARTY_VERSION = '3.1.32-dev-41';
/** /**
* define variable scopes * define variable scopes
*/ */

View File

@@ -104,8 +104,7 @@ class Smarty_Internal_Compile_Section extends Smarty_Internal_Compile_Private_Fo
// maybe nocache because of nocache variables // maybe nocache because of nocache variables
$compiler->nocache = $compiler->nocache | $compiler->tag_nocache; $compiler->nocache = $compiler->nocache | $compiler->tag_nocache;
$initLocal = $initLocal = array();
array('saved' => "isset(\$_smarty_tpl->tpl_vars['__smarty_section_{$attributes['name']}']) ? \$_smarty_tpl->tpl_vars['__smarty_section_{$attributes['name']}'] : false",);
$initNamedProperty = array(); $initNamedProperty = array();
$initFor = array(); $initFor = array();
$incFor = array(); $incFor = array();
@@ -455,9 +454,6 @@ class Smarty_Internal_Compile_Sectionclose extends Smarty_Internal_CompileBase
} else { } else {
$output .= "}\n}\n"; $output .= "}\n}\n";
} }
$output .= "if ({$local}saved) {\n";
$output .= "{$sectionVar} = {$local}saved;\n";
$output .= "}\n";
$output .= '?>'; $output .= '?>';
return $output; return $output;