mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 10:54:27 +02:00
- bugfix when passing an array as default parameter at {function} tag
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
===== SVN trunk =====
|
||||
14/12/2010
|
||||
- bugfix when passing an array as default parameter at {function} tag
|
||||
|
||||
13/12/2010
|
||||
- bugfix {$smarty.template} in child template did not return right content
|
||||
|
@@ -43,7 +43,8 @@ class Smarty_Internal_Compile_Function extends Smarty_Internal_CompileBase {
|
||||
unset($_attr['name']);
|
||||
$compiler->template->properties['function'][$_name]['parameter'] = array();
|
||||
foreach ($_attr as $_key => $_data) {
|
||||
$compiler->template->properties['function'][$_name]['parameter'][$_key] = $_data;
|
||||
eval ('$tmp='.$_data.';');
|
||||
$compiler->template->properties['function'][$_name]['parameter'][$_key] = $tmp;
|
||||
}
|
||||
$compiler->smarty->template_functions[$_name]['parameter'] = $compiler->template->properties['function'][$_name]['parameter'];
|
||||
if ($compiler->template->caching) {
|
||||
@@ -52,7 +53,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->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(\$value);};
|
||||
foreach (\$params as \$key => \$value) {\$_smarty_tpl->tpl_vars[\$key] = new Smarty_variable(\$value);}?>";
|
||||
}
|
||||
// Init temporay context
|
||||
|
Reference in New Issue
Block a user