[prev in list] [next in list] [prev in thread] [next in thread]
List: smarty-cvs
Subject: [SMARTY-CVS] cvs: smarty / Smarty_Compiler.class.php
From: "Monte Ohrt" <monte () ispi ! net>
Date: 2003-01-08 15:47:48
[Download RAW message or body]
mohrt Wed Jan 8 10:47:48 2003 EDT
Modified files:
/smarty Smarty_Compiler.class.php
Log:
fix bug with >= tests in if statements, comment out full object support
Index: smarty/Smarty_Compiler.class.php
diff -u smarty/Smarty_Compiler.class.php:1.144 smarty/Smarty_Compiler.class.php:1.145
--- smarty/Smarty_Compiler.class.php:1.144 Tue Dec 24 12:07:43 2002
+++ smarty/Smarty_Compiler.class.php Wed Jan 8 10:47:48 2003
@@ -127,16 +127,15 @@
// "text"
$this->_var_regexp = '(?:' . $this->_avar_regexp . '|' . $this->_qstr_regexp . ')';
- // matches valid object call (no objects allowed in parameters):
+ // matches valid object property access
// $foo->bar
- // $foo->bar()
- // $foo->bar("text")
- // $foo->bar($foo, $bar, "text")
- // $foo->bar($foo|bar, "foo"|bar)
- // $foo->bar->foo()
- // $foo->bar->foo->bar()
- $this->_obj_start_regexp = '(?:\$\w+(?:\.\w+)*(?:\->\w+)+)';
+ // $foo.bar->bar
+ // $foo.bar.foo->bar
+ // $foo->bar->foo
+ // $foo->bar->foo->bar
+ $this->_obj_call_regexp = '(?:' . $this->_dvar_regexp . '(?:\->\w+)+)';
+/* // this is code for allowing full object access, not officially supported
// matches valid object call (no objects allowed in parameters):
// $foo->bar
// $foo->bar()
@@ -145,9 +144,11 @@
// $foo->bar($foo|bar, "foo"|bar)
// $foo->bar->foo()
// $foo->bar->foo->bar()
+ $this->_obj_start_regexp = ''(?:' . $this->_dvar_regexp . '(?:\->\w+)+)';
$this->_obj_call_regexp = '(?:' . $this->_obj_start_regexp . '(?:\((?:\w+|'
. $this->_var_regexp . '(?>' . $this->_mod_regexp . '*)(?:\s*,\s*(?:(?:\w+|'
. $this->_var_regexp . '(?>' . $this->_mod_regexp . '*))))*)?\))?)';
+*/
// matches valid function name:
// foo123
@@ -968,7 +969,7 @@
preg_match_all('/(?>
' . $this->_obj_call_regexp . '(?:' . $this->_mod_regexp . '*) | # valid object call
' . $this->_var_regexp . '(?:' . $this->_mod_regexp . '*) | # var or quoted string
- \d+|!==|<=>|==|!=|<=|=>|\&\&|\|\||\(|\)|,|\!|\^|=|<|>|\||\% | # valid non-word token
+ \d+|!==|<=>|==|!=|<=|>=|\&\&|\|\||\(|\)|,|\!|\^|=|<|>|\||\% | # valid non-word token
\b\w+\b | # valid word token
\S+ # anything else
)/x', $tag_args, $match);
--
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic