From 1454db3946368828b57261f1d571170627871302 Mon Sep 17 00:00:00 2001 From: andrey Date: Mon, 5 Feb 2001 16:12:57 +0000 Subject: [PATCH] Removing once-only subpattern for now.. --- Smarty.class.php | 18 +++++++++--------- libs/Smarty.class.php | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Smarty.class.php b/Smarty.class.php index d9f81670..ca1ceaff 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -553,9 +553,9 @@ class Smarty /* If the tag name matches a variable or section property definition, we simply process it. */ - if (preg_match('!^\$(\w+/)*\w+(?>\.\w+)*(?>\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tag_command) || // if a variable - preg_match('!^#(\w+)#(?>\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tag_command) || // or a configuration variable - preg_match('!^%\w+\.\w+%(?>\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tag_command)) { // or a section property + if (preg_match('!^\$(\w+/)*\w+(?>\.\w+)*(\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tag_command) || // if a variable + preg_match('!^#(\w+)#(\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tag_command) || // or a configuration variable + preg_match('!^%\w+\.\w+%(\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tag_command)) { // or a section property settype($tag_command, 'array'); $this->_parse_vars_props($tag_command); return ""; @@ -1019,13 +1019,13 @@ class Smarty allow people to use older versions of PHP we emulate preg_grep() and use the version check to see what function to call. */ if (strnatcmp(PHP_VERSION, '4.0.4') >= 0) { - $var_exprs = preg_grep('!^\$(\w+/)*\w+(?>\.\w+)*(?>\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); - $conf_var_exprs = preg_grep('!^#(\w+)#(?>\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); - $sect_prop_exprs = preg_grep('!^%\w+\.\w+%(?>\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); + $var_exprs = preg_grep('!^\$(\w+/)*\w+(?>\.\w+)*(\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); + $conf_var_exprs = preg_grep('!^#(\w+)#(\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); + $sect_prop_exprs = preg_grep('!^%\w+\.\w+%(\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); } else { - $var_exprs = $this->_preg_grep('!^\$(\w+/)*\w+(?>\.\w+)*(?>\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); - $conf_var_exprs = $this->_preg_grep('!^#(\w+)#(?>\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); - $sect_prop_exprs = $this->_preg_grep('!^%\w+\.\w+%(?>\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); + $var_exprs = $this->_preg_grep('!^\$(\w+/)*\w+(?>\.\w+)*(\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); + $conf_var_exprs = $this->_preg_grep('!^#(\w+)#(\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); + $sect_prop_exprs = $this->_preg_grep('!^%\w+\.\w+%(\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); } if (count($var_exprs)) { diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index d9f81670..ca1ceaff 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -553,9 +553,9 @@ class Smarty /* If the tag name matches a variable or section property definition, we simply process it. */ - if (preg_match('!^\$(\w+/)*\w+(?>\.\w+)*(?>\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tag_command) || // if a variable - preg_match('!^#(\w+)#(?>\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tag_command) || // or a configuration variable - preg_match('!^%\w+\.\w+%(?>\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tag_command)) { // or a section property + if (preg_match('!^\$(\w+/)*\w+(?>\.\w+)*(\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tag_command) || // if a variable + preg_match('!^#(\w+)#(\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tag_command) || // or a configuration variable + preg_match('!^%\w+\.\w+%(\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tag_command)) { // or a section property settype($tag_command, 'array'); $this->_parse_vars_props($tag_command); return ""; @@ -1019,13 +1019,13 @@ class Smarty allow people to use older versions of PHP we emulate preg_grep() and use the version check to see what function to call. */ if (strnatcmp(PHP_VERSION, '4.0.4') >= 0) { - $var_exprs = preg_grep('!^\$(\w+/)*\w+(?>\.\w+)*(?>\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); - $conf_var_exprs = preg_grep('!^#(\w+)#(?>\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); - $sect_prop_exprs = preg_grep('!^%\w+\.\w+%(?>\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); + $var_exprs = preg_grep('!^\$(\w+/)*\w+(?>\.\w+)*(\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); + $conf_var_exprs = preg_grep('!^#(\w+)#(\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); + $sect_prop_exprs = preg_grep('!^%\w+\.\w+%(\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); } else { - $var_exprs = $this->_preg_grep('!^\$(\w+/)*\w+(?>\.\w+)*(?>\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); - $conf_var_exprs = $this->_preg_grep('!^#(\w+)#(?>\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); - $sect_prop_exprs = $this->_preg_grep('!^%\w+\.\w+%(?>\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); + $var_exprs = $this->_preg_grep('!^\$(\w+/)*\w+(?>\.\w+)*(\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); + $conf_var_exprs = $this->_preg_grep('!^#(\w+)#(\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); + $sect_prop_exprs = $this->_preg_grep('!^%\w+\.\w+%(\|@?\w+(:(' . $qstr_regexp . '|[^|]+))?)*$!', $tokens); } if (count($var_exprs)) {