mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
fix 'is even by' and 'is odd by' logic
This commit is contained in:
1
NEWS
1
NEWS
@@ -1,3 +1,4 @@
|
||||
- fix 'is even by' and 'is odd by' logic (Monte)
|
||||
- add day_empty, month_empty, year_empty and all_empty attributes to
|
||||
html_select_date (messju)
|
||||
- add table of explanation for {if} qualifiers in docs (boots)
|
||||
|
@@ -1385,7 +1385,7 @@ class Smarty_Compiler extends Smarty {
|
||||
if (@$tokens[$expr_end] == 'by') {
|
||||
$expr_end++;
|
||||
$expr_arg = $tokens[$expr_end++];
|
||||
$expr = "!(($is_arg / $expr_arg) % " . $this->_parse_var_props($expr_arg) . ")";
|
||||
$expr = "!(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))";
|
||||
} else
|
||||
$expr = "!($is_arg % 2)";
|
||||
break;
|
||||
@@ -1394,7 +1394,7 @@ class Smarty_Compiler extends Smarty {
|
||||
if (@$tokens[$expr_end] == 'by') {
|
||||
$expr_end++;
|
||||
$expr_arg = $tokens[$expr_end++];
|
||||
$expr = "(($is_arg / $expr_arg) % ". $this->_parse_var_props($expr_arg) . ")";
|
||||
$expr = "(1 & ($is_arg / " . $this->_parse_var_props($expr_arg) . "))";
|
||||
} else
|
||||
$expr = "($is_arg % 2)";
|
||||
break;
|
||||
|
Reference in New Issue
Block a user