diff --git a/NEWS b/NEWS index 57c20671..a60b007b 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ + - added simple math operators to variables (Monte) - reverted patch for case-insensitive tag-names (messju) - enabled array(&$obj. 'source', 'timestamp', 'secure', 'trusted') as callback for register_resource() (messju); diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index bd24ce79..3cd05980 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -112,7 +112,7 @@ class Smarty_Compiler extends Smarty { // $foo[5][blah] // $foo[5].bar[$foobar][4] $this->_dvar_guts_regexp = '\w+(?:' . $this->_var_bracket_regexp - . ')*(?:\.\$?\w+(?:' . $this->_var_bracket_regexp . ')*)*'; + . ')*(?:\.\$?\w+(?:' . $this->_var_bracket_regexp . ')*)*(?:\+\+|\-\-|(?:[\+\-\*\/]\d+(?:\.\d+)?))?'; $this->_dvar_regexp = '\$' . $this->_dvar_guts_regexp; // matches config vars: