diff --git a/change_log.txt b/change_log.txt index 1758f612..427ddf12 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,3 +1,6 @@ +17/11/2010 +- bugfix on {call} with variable function name + 16/11/2010 - bugfix whitespace in front of "template->properties['nocache_hash']); // was there an assign attribute if (isset($_assign)) { if ($compiler->template->caching) { - $_output = "assign({$_assign}, ob_get_clean());?>\n"; + $_output = "assign({$_assign}, ob_get_clean());?>\n"; } else { - $_output = "assign({$_assign}, ob_get_clean());?>\n"; + $_output = "assign({$_assign}, ob_get_clean());?>\n"; } } else { if ($compiler->template->caching) { - $_output = "\n"; + $_output = "\n"; } else { - $_output = "\n"; + $_output = "\n"; } } return $_output; diff --git a/libs/sysplugins/smarty_internal_compile_function.php b/libs/sysplugins/smarty_internal_compile_function.php index 6808ae5f..54429ebd 100644 --- a/libs/sysplugins/smarty_internal_compile_function.php +++ b/libs/sysplugins/smarty_internal_compile_function.php @@ -52,7 +52,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 (\$_smarty_tpl->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 diff --git a/libs/sysplugins/smarty_internal_function_call_handler.php b/libs/sysplugins/smarty_internal_function_call_handler.php index 543c77b4..44039169 100644 --- a/libs/sysplugins/smarty_internal_function_call_handler.php +++ b/libs/sysplugins/smarty_internal_function_call_handler.php @@ -22,6 +22,7 @@ class Smarty_Internal_Function_Call_Handler extends Smarty_Internal_Template { if (!is_callable($_function)) { $_code = "function {$_function}(\$_smarty_tpl,\$params) { \$saved_tpl_vars = \$_smarty_tpl->tpl_vars; + foreach (\$_smarty_tpl->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);}?>"; if ($_nocache) { $_code .= preg_replace(array("!<\?php echo \\'/\*%%SmartyNocache:{$_template->smarty->template_functions[$_name]['nocache_hash']}%%\*/|/\*/%%SmartyNocache:{$_template->smarty->template_functions[$_name]['nocache_hash']}%%\*/\\';\?>!",