backed out errornously committed support for $foo->$bar

This commit is contained in:
messju
2003-06-30 22:13:00 +00:00
parent 38ed839cce
commit 52e2093abe

View File

@@ -1606,7 +1606,7 @@ class Smarty_Compiler extends Smarty {
} }
// get [foo] and .foo and ->foo and (...) pieces // get [foo] and .foo and ->foo and (...) pieces
preg_match_all('!(?:^\w+)|' . $this->_obj_params_regexp . '|(?:' . $this->_var_bracket_regexp . ')|->\$?\w+|\.\$?\w+|\S+!', $_var_ref, $match); preg_match_all('!(?:^\w+)|' . $this->_obj_params_regexp . '|(?:' . $this->_var_bracket_regexp . ')|->\w+|\.\$?\w+|\S+!', $_var_ref, $match);
$_indexes = $match[0]; $_indexes = $match[0];
$_var_name = array_shift($_indexes); $_var_name = array_shift($_indexes);
@@ -1635,7 +1635,7 @@ class Smarty_Compiler extends Smarty {
} else { } else {
$_output = "\$this->_tpl_vars['$_var_name']"; $_output = "\$this->_tpl_vars['$_var_name']";
} }
foreach ($_indexes as $_index) { foreach ($_indexes as $_index) {
if ($_index{0} == '[') { if ($_index{0} == '[') {
$_index = substr($_index, 1, -1); $_index = substr($_index, 1, -1);
@@ -1659,15 +1659,8 @@ class Smarty_Compiler extends Smarty {
$this->_syntax_error('call to internal object members is not allowed', E_USER_ERROR, __FILE__, __LINE__); $this->_syntax_error('call to internal object members is not allowed', E_USER_ERROR, __FILE__, __LINE__);
} elseif($this->security && substr($_index, 2, 1) == '_') { } elseif($this->security && substr($_index, 2, 1) == '_') {
$this->_syntax_error('(secure) call to private object member is not allowed', E_USER_ERROR, __FILE__, __LINE__); $this->_syntax_error('(secure) call to private object member is not allowed', E_USER_ERROR, __FILE__, __LINE__);
} elseif ($_index{2} == '$') { }
if ($this->security) { $_output .= $_index;
$this->_syntax_error('(secure) call to dynamic object member is not allowed', E_USER_ERROR, __FILE__, __LINE__);
} else {
$_output .= '->{$this->_tpl_vars[\''.substr($_index,3).'\']}';
}
} else {
$_output .= $_index;
}
} elseif ($_index{0} == '(') { } elseif ($_index{0} == '(') {
$_index = $this->_parse_parenth_args($_index); $_index = $this->_parse_parenth_args($_index);
$_output .= $_index; $_output .= $_index;