- bugfix global variable assigned within template function are not seen after template function exit (Forum Topic 23800)

This commit is contained in:
uwe.tews@googlemail.com
2012-11-26 20:11:10 +00:00
parent 9c6bda43d0
commit 88693d327a
2 changed files with 5 additions and 1 deletions

View File

@@ -1,4 +1,7 @@
===== trunk =====
26.11.2012
- bugfix global variable assigned within template function are not seen after template function exit (Forum Topic 23800)
24.11.2012
- made SmartyBC loadable via composer (Issue #124)

View File

@@ -149,7 +149,8 @@ class Smarty_Internal_Compile_Functionclose extends Smarty_Internal_CompileBase
$compiler->has_code = false;
$output = true;
} else {
$output = $plugins_string . $compiler->parser->current_buffer->to_smarty_php() . "<?php \$_smarty_tpl->tpl_vars = \$saved_tpl_vars;}}?>\n";
$output = $plugins_string . $compiler->parser->current_buffer->to_smarty_php() . "<?php \$_smarty_tpl->tpl_vars = \$saved_tpl_vars;
foreach (Smarty::\$global_tpl_vars as \$key => \$value) if(!isset(\$_smarty_tpl->tpl_vars[\$key])) \$_smarty_tpl->tpl_vars[\$key] = \$value;}}?>\n";
}
// reset flag that we are compiling a template function
$compiler->compiles_template_function = false;