mirror of
https://github.com/smarty-php/smarty.git
synced 2025-11-03 05:41:37 +01:00
fix accidental commit
This commit is contained in:
@@ -55,6 +55,7 @@ class Smarty_Compiler extends Smarty {
|
||||
var $_si_qstr_regexp = null;
|
||||
var $_qstr_regexp = null;
|
||||
var $_func_regexp = null;
|
||||
var $_dvar__gets_regexp = null;
|
||||
var $_dvar_regexp = null;
|
||||
var $_cvar_regexp = null;
|
||||
var $_svar_regexp = null;
|
||||
@@ -86,14 +87,15 @@ class Smarty_Compiler extends Smarty {
|
||||
$this->_qstr_regexp = '(?:' . $this->_db_qstr_regexp . '|' . $this->_si_qstr_regexp . ')';
|
||||
|
||||
// matches $ vars (not objects):
|
||||
// $foo
|
||||
// $foo.bar
|
||||
// $foo.bar.foobar
|
||||
// $foo[0]
|
||||
// $foo[$bar]
|
||||
// $foo[5][blah]
|
||||
// $foo[5].bar[$foobar][4]
|
||||
$this->_dvar_regexp = '\$\w+(?:\[\$?[\w\.]+\])*(?:\.\$?\w+(?:\[\$?[\w\.]+\])*)*';
|
||||
// foo
|
||||
// foo.bar
|
||||
// foo.bar.foobar
|
||||
// foo[0]
|
||||
// foo[$bar]
|
||||
// foo[5][blah]
|
||||
// foo[5].bar[$foobar][4]
|
||||
$this->_dvar_guts_regexp = '\w+(?:\[\$?[\w\.]+\])*(?:\.\$?\w+(?:\[\$?[\w\.]+\])*)*';
|
||||
$this->_dvar_regexp = '\$' . $this->_dvar_guts_regexp;
|
||||
|
||||
// matches config vars:
|
||||
// #foo#
|
||||
@@ -130,13 +132,15 @@ class Smarty_Compiler extends Smarty {
|
||||
|
||||
// matches valid object call (no objects allowed in parameters):
|
||||
// $foo->bar
|
||||
// $foo->bar[0]
|
||||
// $foo->bar[$x].foobar
|
||||
// $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 = '(?:' . $this->_dvar_regexp . '(?:\->\w+)+)';
|
||||
$this->_obj_start_regexp = '(?:' . $this->_dvar_regexp . '(?:\->' . $this->_dvar_guts_regexp . ')+)';
|
||||
$this->_obj_call_regexp = '(?:' . $this->_obj_start_regexp . '(?:\((?:\w+|'
|
||||
. $this->_var_regexp . '(?>' . $this->_mod_regexp . '*)(?:\s*,\s*(?:(?:\w+|'
|
||||
. $this->_var_regexp . '(?>' . $this->_mod_regexp . '*))))*)?\))?)';
|
||||
|
||||
Reference in New Issue
Block a user