update imbedded vars, allow special $smarty vars

This commit is contained in:
mohrt
2003-02-19 17:26:48 +00:00
parent d9b2c672e5
commit 7f0ceb703a
3 changed files with 3 additions and 3 deletions

2
NEWS
View File

@@ -1,6 +1,6 @@
- add support for appending key=>value vars (messju, Monte) - add support for appending key=>value vars (messju, Monte)
- change embedded variable logic to only recognize $foo and - change embedded variable logic to only recognize $foo and
$foo[0][bar] syntax (Monte) $foo[0][bar] and $smarty.foo.bar syntax (Monte)
- allow null as function attribute value - allow null as function attribute value
(Andr<64> Rabold, Monte) (Andr<64> Rabold, Monte)
- support $foo->bar[index] syntax (Monte) - support $foo->bar[index] syntax (Monte)

View File

@@ -1446,7 +1446,7 @@ class Smarty_Compiler extends Smarty {
function _expand_quoted_text($var_expr) function _expand_quoted_text($var_expr)
{ {
// if contains unescaped $, expand it // if contains unescaped $, expand it
if(preg_match_all('|(?<!\\\\)\$\w+(?:' . $this->_var_bracket_regexp . ')*|', $var_expr, $match)) { if(preg_match_all('%(?<!\\\\)\$(?:smarty(?:\.\w+)+|\w+(?:' . $this->_var_bracket_regexp . ')*)%', $var_expr, $match)) {
rsort($match[0]); rsort($match[0]);
reset($match[0]); reset($match[0]);
foreach($match[0] as $var) { foreach($match[0] as $var) {

View File

@@ -1446,7 +1446,7 @@ class Smarty_Compiler extends Smarty {
function _expand_quoted_text($var_expr) function _expand_quoted_text($var_expr)
{ {
// if contains unescaped $, expand it // if contains unescaped $, expand it
if(preg_match_all('|(?<!\\\\)\$\w+(?:' . $this->_var_bracket_regexp . ')*|', $var_expr, $match)) { if(preg_match_all('%(?<!\\\\)\$(?:smarty(?:\.\w+)+|\w+(?:' . $this->_var_bracket_regexp . ')*)%', $var_expr, $match)) {
rsort($match[0]); rsort($match[0]);
reset($match[0]); reset($match[0]);
foreach($match[0] as $var) { foreach($match[0] as $var) {