From ecd1793bdf817692fcf40281c3deaee5cf275d66 Mon Sep 17 00:00:00 2001 From: "uwe.tews@googlemail.com" Date: Wed, 27 Oct 2010 16:42:01 +0000 Subject: [PATCH] - bugfix default parameter values did not work for template functions included with {include} --- change_log.txt | 3 +++ libs/sysplugins/smarty_internal_compile_function.php | 1 + 2 files changed, 4 insertions(+) diff --git a/change_log.txt b/change_log.txt index 2c964223..9ab445dc 100644 --- a/change_log.txt +++ b/change_log.txt @@ -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 diff --git a/libs/sysplugins/smarty_internal_compile_function.php b/libs/sysplugins/smarty_internal_compile_function.php index 0080704a..82bd9778 100644 --- a/libs/sysplugins/smarty_internal_compile_function.php +++ b/libs/sysplugins/smarty_internal_compile_function.php @@ -43,6 +43,7 @@ class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase { $output = "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