From 8cbe83510b4f642facfe7689e8daf29dd6b6a1f3 Mon Sep 17 00:00:00 2001 From: mohrt Date: Thu, 9 Sep 2004 13:40:14 +0000 Subject: [PATCH] fix compile problem with numeric constants and math operator matching --- libs/Smarty_Compiler.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/Smarty_Compiler.class.php b/libs/Smarty_Compiler.class.php index 0408f5b3..82373263 100644 --- a/libs/Smarty_Compiler.class.php +++ b/libs/Smarty_Compiler.class.php @@ -111,7 +111,7 @@ class Smarty_Compiler extends Smarty { // $foo[$bar] // $foo[5][blah] // $foo[5].bar[$foobar][4] - $this->_dvar_math_regexp = '[\+\*\/\%]|-(?!>)'; + $this->_dvar_math_regexp = '(?:[\+\*\/\%]|(?:-(?!>)))'; $this->_dvar_math_var_regexp = '[\$\w\.\+\-\*\/\%\d\>\[\]]'; $this->_dvar_guts_regexp = '\w+(?:' . $this->_var_bracket_regexp . ')*(?:\.\$?\w+(?:' . $this->_var_bracket_regexp . ')*)*(?:' . $this->_dvar_math_regexp . '(?:' . $this->_num_const_regexp . '|' . $this->_dvar_math_var_regexp . ')*)?'; @@ -148,7 +148,7 @@ class Smarty_Compiler extends Smarty { // $foo->bar->foo() // $foo->bar->foo->bar() $this->_obj_ext_regexp = '\->(?:\$?' . $this->_dvar_guts_regexp . ')'; - $this->_obj_params_regexp = '\((?:-?\d|\w+|' + $this->_obj_params_regexp = '\((?:(?:' . $this->_num_const_regexp . ')|\w+|' . $this->_var_regexp . '(?:\s*,\s*(?:(?:\w+|' . $this->_var_regexp . ')))*)?\)'; $this->_obj_start_regexp = '(?:' . $this->_dvar_regexp . '(?:' . $this->_obj_ext_regexp . ')+)';