- bugfix default parameter values did not work for template functions included with {include}

This commit is contained in:
uwe.tews@googlemail.com
2010-10-27 16:42:01 +00:00
parent 5176f39583
commit ecd1793bdf
2 changed files with 4 additions and 0 deletions

View File

@@ -1,3 +1,6 @@
27/10/2010
- bugfix default parameter values did not work for template functions included with {include}
25/10/2010
- bugfix for E_NOTICE change, array elements did not work as modifier parameter

View File

@@ -43,6 +43,7 @@ class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase {
$output = "<?php if (!function_exists('smarty_template_function_{$_name}')) {
function smarty_template_function_{$_name}(\$_smarty_tpl,\$params) {
\$saved_tpl_vars = \$_smarty_tpl->tpl_vars;
foreach (\$_smarty_tpl->smarty->template_functions['{$_name}']['parameter'] as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(trim(\$value,'\''));};
foreach (\$params as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);}?>";
}
// Init temporay context