-bugfix {assign} in a nocache section should not overwrite existing variable values

during compilation (issue 109)
This commit is contained in:
uwe.tews@googlemail.com
2012-07-30 20:07:51 +00:00
parent 50b3a4f070
commit 897d40fe5c
2 changed files with 9 additions and 1 deletions

View File

@@ -1,4 +1,8 @@
===== trunk ===== ===== trunk =====
30.07.2012
-bugfix {assign} in a nocache section should not overwrite existing variable values
during compilation (issue 109)
28.07.2012 28.07.2012
- bugfix array access of config variables did not work (Forum Topic 22527) - bugfix array access of config variables did not work (Forum Topic 22527)

View File

@@ -39,8 +39,12 @@ class Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase {
if ($compiler->tag_nocache || $compiler->nocache) { if ($compiler->tag_nocache || $compiler->nocache) {
$_nocache = 'true'; $_nocache = 'true';
// create nocache var to make it know for further compiling // create nocache var to make it know for further compiling
if (isset($compiler->template->tpl_vars[trim($_attr['var'], "'")])) {
$compiler->template->tpl_vars[trim($_attr['var'], "'")]->nocache = true;
} else {
$compiler->template->tpl_vars[trim($_attr['var'], "'")] = new Smarty_variable(null, true); $compiler->template->tpl_vars[trim($_attr['var'], "'")] = new Smarty_variable(null, true);
} }
}
// scope setup // scope setup
if (isset($_attr['scope'])) { if (isset($_attr['scope'])) {
$_attr['scope'] = trim($_attr['scope'], "'\""); $_attr['scope'] = trim($_attr['scope'], "'\"");