recognize $foo[][] syntax in embedded quotes without backticks

This commit is contained in:
mohrt
2003-04-04 20:15:48 +00:00
parent 3dc4558b4a
commit da67d8edce
2 changed files with 3 additions and 1 deletions

2
NEWS
View File

@@ -1,3 +1,5 @@
- recognize $foo[][] syntax inside embedded quotes without
backtics (Monte)
- name=123 is passed as an integer (not a string) to plugins now (messju) - name=123 is passed as an integer (not a string) to plugins now (messju)
- $length is now propagated to sub-values in debug_print_var (messju) - $length is now propagated to sub-values in debug_print_var (messju)

View File

@@ -1452,7 +1452,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('%(?<!\\\\)\$(?:\`' . $this->_dvar_guts_regexp . '\`|\w+)%', $var_expr, $_match)) { if(preg_match_all('%(?<!\\\\)\$(?:\`' . $this->_dvar_guts_regexp . '\`|\w+(\[[a-zA-Z0-9]+\])*)%', $var_expr, $_match)) {
$_match = $_match[0]; $_match = $_match[0];
rsort($_match); rsort($_match);
reset($_match); reset($_match);