mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 19:34:27 +02:00
- bugfix on object as array index
This commit is contained in:
@@ -24,7 +24,7 @@ class Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase {
|
||||
{
|
||||
$this->compiler = $compiler;
|
||||
$this->required_attributes = array('var', 'value');
|
||||
$this->optional_attributes = array('scope', 'nocache', 'index');
|
||||
$this->optional_attributes = array('scope', 'nocache', 'smarty_internal_index');
|
||||
|
||||
$_nocache = 'null';
|
||||
$_scope = 'null';
|
||||
@@ -49,16 +49,12 @@ class Smarty_Internal_Compile_Assign extends Smarty_Internal_CompileBase {
|
||||
$_scope = SMARTY_GLOBAL_SCOPE;
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($_attr['index'])) {
|
||||
$_index = $_attr['index'];
|
||||
}
|
||||
// compiled output
|
||||
if (isset($_attr['index'])) {
|
||||
if ($_attr['index'] == '') {
|
||||
if (isset($_attr['smarty_internal_index'])) {
|
||||
if ($_attr['smarty_internal_index'] == '') {
|
||||
return "<?php \$_smarty_tpl->append($_attr[var],$_attr[value],false,$_nocache,$_scope);?>";
|
||||
} else {
|
||||
return "<?php \$_tmp$_attr[index] = $_attr[value]; \$_smarty_tpl->append($_attr[var],\$_tmp,true,$_nocache,$_scope); unset (\$_tmp);?>";
|
||||
return "<?php \$_tmp$_attr[smarty_internal_index] = $_attr[value]; \$_smarty_tpl->append($_attr[var],\$_tmp,true,$_nocache,$_scope); unset (\$_tmp);?>";
|
||||
}
|
||||
} else {
|
||||
return "<?php \$_smarty_tpl->assign($_attr[var],$_attr[value],$_nocache,$_scope);?>";
|
||||
|
@@ -2146,8 +2146,8 @@ static public $yy_action = array(
|
||||
function yy_r113(){$this->_retvalue = '('.$this->yystack[$this->yyidx + -1]->minor.')'; }
|
||||
#line 2142 "smarty_internal_templateparser.php"
|
||||
#line 420 "smarty_internal_templateparser.y"
|
||||
function yy_r114(){ if ($this->yystack[$this->yyidx + -1]->minor['var'] == '\'smarty\'') { $this->_retvalue = $this->compiler->compileTag('special_smarty_variable',$this->yystack[$this->yyidx + -1]->minor['index']).$this->yystack[$this->yyidx + 0]->minor;} else {
|
||||
$this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -1]->minor['var'] .')->value'.$this->yystack[$this->yyidx + -1]->minor['index'].$this->yystack[$this->yyidx + 0]->minor; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + -1]->minor['var'],"'"), null, true, false)->nocache;} }
|
||||
function yy_r114(){ if ($this->yystack[$this->yyidx + -1]->minor['var'] == '\'smarty\'') { $this->_retvalue = $this->compiler->compileTag('special_smarty_variable',$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index']).$this->yystack[$this->yyidx + 0]->minor;} else {
|
||||
$this->_retvalue = '$_smarty_tpl->getVariable('. $this->yystack[$this->yyidx + -1]->minor['var'] .')->value'.$this->yystack[$this->yyidx + -1]->minor['smarty_internal_index'].$this->yystack[$this->yyidx + 0]->minor; $this->compiler->tag_nocache=$this->compiler->tag_nocache|$this->template->getVariable(trim($this->yystack[$this->yyidx + -1]->minor['var'],"'"), null, true, false)->nocache;} }
|
||||
#line 2146 "smarty_internal_templateparser.php"
|
||||
#line 423 "smarty_internal_templateparser.y"
|
||||
function yy_r115(){$this->_retvalue = $this->yystack[$this->yyidx + 0]->minor; }
|
||||
|
Reference in New Issue
Block a user