mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
fix _run_mod_handler routine
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
@@ -1689,7 +1689,6 @@ class Smarty_Compiler extends Smarty {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* add plugin
|
||||
*
|
||||
|
Reference in New Issue
Block a user