diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index 08bdb6d7..b7d33a1c 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -1363,9 +1363,14 @@ class Smarty_Compiler extends Smarty { /* If last token was a ')', we operate on the parenthesized expression. The start of the expression is on the stack. Otherwise, we operate on the last encountered token. */ - if ($tokens[$i-1] == ')') + if ($tokens[$i-1] == ')') { $is_arg_start = array_pop($is_arg_stack); - else + if ($is_arg_start != 0) { + if (preg_match('~^' . $this->_func_regexp . '$~', $tokens[$is_arg_start-1])) { + $is_arg_start--; + } + } + } else $is_arg_start = $i-1; /* Construct the argument for 'is' expression, so it knows what to operate on. */