fix _run_mod_handler routine

This commit is contained in:
mohrt
2003-06-17 15:23:25 +00:00
parent e837781093
commit 2ffb0e2921
2 changed files with 10 additions and 9 deletions

View File

@@ -1521,23 +1521,25 @@ reques * @var string
* @param array|null $map_array
* @return string result of modifiers
*/
function _run_mod_handler($_modifier_name, $_map_array, $_modifier_args)
{
$_func_name = $this->_plugins['modifier'][$_modifier_name][0];
$_var = $_modifier_args[0];
function _run_mod_handler()
{
$_args = func_get_args();
list($_modifier_name, $_map_array) = array_splice($_args, 0, 2);
list($_func_name, $_tpl_file, $_tpl_line) =
$this->_plugins['modifier'][$_modifier_name];
$_var = $_args[0];
if ($_map_array && is_array($_var)) {
foreach ($_var as $_key => $_val) {
$_modifier_args[0] = $_val;
$_var[$_key] = call_user_func_array($_func_name, $_modifier_args);
$_args[0] = $_val;
$_var[$_key] = call_user_func_array($_func_name, $_args);
}
return $_var;
} else {
return call_user_func_array($_func_name, $_modifier_args);
return call_user_func_array($_func_name, $_args);
}
}
/**
* Remove starting and ending quotes from the string
*

View File

@@ -1689,7 +1689,6 @@ class Smarty_Compiler extends Smarty {
}
}
/**
* add plugin
*