diff --git a/NEWS b/NEWS index 6f6fa957..918ff3e9 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ + - fix handling of methods arguments (messju, Manfred Wischin) - remove touch() call that made the compiled-template's timestamp the same as the source-template's one. (messju) - add assign attribute to html_checkboxes and html_radios diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index aebeb23c..b7367719 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -1811,12 +1811,13 @@ class Smarty_Compiler extends Smarty { function _parse_parenth_args($parenth_args) { preg_match_all('!' . $this->_param_regexp . '!',$parenth_args, $match); - $match = $match[0]; - rsort($match); - reset($match); - $orig_vals = $match; + $orig_vals = $match = $match[0]; $this->_parse_vars_props($match); - return str_replace($orig_vals, $match, $parenth_args); + $replace = array(); + for ($i = 0, $count = count($match); $i < $count; $i++) { + $replace[$orig_vals[$i]] = $match[$i]; + } + return strtr($parenth_args, $replace); } /**