mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-09 12:54:26 +02:00
fix that function results can be used together with conditions like "is even" at the {if} tag (U.Tews)
This commit is contained in:
@@ -1363,9 +1363,14 @@ class Smarty_Compiler extends Smarty {
|
|||||||
/* If last token was a ')', we operate on the parenthesized
|
/* If last token was a ')', we operate on the parenthesized
|
||||||
expression. The start of the expression is on the stack.
|
expression. The start of the expression is on the stack.
|
||||||
Otherwise, we operate on the last encountered token. */
|
Otherwise, we operate on the last encountered token. */
|
||||||
if ($tokens[$i-1] == ')')
|
if ($tokens[$i-1] == ')') {
|
||||||
$is_arg_start = array_pop($is_arg_stack);
|
$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;
|
$is_arg_start = $i-1;
|
||||||
/* Construct the argument for 'is' expression, so it knows
|
/* Construct the argument for 'is' expression, so it knows
|
||||||
what to operate on. */
|
what to operate on. */
|
||||||
|
Reference in New Issue
Block a user