- bugfix assign() in plugins called in subtemplates did change value also in parent template

This commit is contained in:
uwe.tews@googlemail.com
2011-10-04 16:18:24 +00:00
parent 9ca21fac77
commit dbda42bc6c
2 changed files with 11 additions and 18 deletions

View File

@@ -1,4 +1,7 @@
===== trunk =====
04.10.2011
- bugfix assign() in plugins called in subtemplates did change value also in parent template
===== Smarty-3.1.2 =====
03.10.2011
- improvement add internal $joined_template_dir property instead computing it on the fly several times

View File

@@ -56,25 +56,15 @@ class Smarty_Internal_Data {
if (is_array($tpl_var)) {
foreach ($tpl_var as $_key => $_val) {
if ($_key != '') {
if (isset($this->tpl_vars[$_key])) {
$this->tpl_vars[$_key]->value = $_val;
$this->tpl_vars[$_key]->nocache = $nocache;
} else {
$this->tpl_vars[$_key] = new Smarty_variable($_val, $nocache);
}
$this->tpl_vars[$_key] = new Smarty_variable($_val, $nocache);
}
}
} else {
if ($tpl_var != '') {
if (isset($this->tpl_vars[$tpl_var])) {
$this->tpl_vars[$tpl_var]->value = $value;
$this->tpl_vars[$tpl_var]->nocache = $nocache;
} else {
$this->tpl_vars[$tpl_var] = new Smarty_variable($value, $nocache);
}
$this->tpl_vars[$tpl_var] = new Smarty_variable($value, $nocache);
}
}
return $this;
}
@@ -91,7 +81,7 @@ class Smarty_Internal_Data {
if ($varname != '') {
Smarty::$global_tpl_vars[$varname] = new Smarty_variable($value, $nocache);
}
return $this;
}
/**
@@ -108,7 +98,7 @@ class Smarty_Internal_Data {
$this->tpl_vars[$tpl_var] = new Smarty_variable(null, $nocache);
$this->tpl_vars[$tpl_var]->value = &$value;
}
return $this;
}
@@ -169,7 +159,7 @@ class Smarty_Internal_Data {
}
}
}
return $this;
}
@@ -198,7 +188,7 @@ class Smarty_Internal_Data {
$this->tpl_vars[$tpl_var]->value[] = &$value;
}
}
return $this;
}
@@ -262,7 +252,7 @@ class Smarty_Internal_Data {
} else {
unset($this->tpl_vars[$tpl_var]);
}
return $this;
}