mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
fix append function with array/string issue
This commit is contained in:
@@ -246,13 +246,19 @@ class Smarty
|
|||||||
{
|
{
|
||||||
if (is_array($tpl_var)) {
|
if (is_array($tpl_var)) {
|
||||||
foreach ($tpl_var as $key => $val) {
|
foreach ($tpl_var as $key => $val) {
|
||||||
if (!empty($key)) {
|
if ($key != '') {
|
||||||
(array)$this->_tpl_vars[$key][] = $val;
|
if(!is_array($this->_tpl_vars[$key])) {
|
||||||
|
settype($this->_tpl_vars[$key],'array');
|
||||||
|
}
|
||||||
|
$this->_tpl_vars[$key][] = $val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!empty($tpl_var) && isset($value)) {
|
if ($tpl_var != '' && isset($value)) {
|
||||||
(array)$this->_tpl_vars[$tpl_var][] = $value;
|
if(!is_array($this->_tpl_vars[$tpl_var])) {
|
||||||
|
settype($this->_tpl_vars[$tpl_var],'array');
|
||||||
|
}
|
||||||
|
$this->_tpl_vars[$tpl_var][] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->_extract = true;
|
$this->_extract = true;
|
||||||
|
@@ -246,13 +246,19 @@ class Smarty
|
|||||||
{
|
{
|
||||||
if (is_array($tpl_var)) {
|
if (is_array($tpl_var)) {
|
||||||
foreach ($tpl_var as $key => $val) {
|
foreach ($tpl_var as $key => $val) {
|
||||||
if (!empty($key)) {
|
if ($key != '') {
|
||||||
(array)$this->_tpl_vars[$key][] = $val;
|
if(!is_array($this->_tpl_vars[$key])) {
|
||||||
|
settype($this->_tpl_vars[$key],'array');
|
||||||
|
}
|
||||||
|
$this->_tpl_vars[$key][] = $val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!empty($tpl_var) && isset($value)) {
|
if ($tpl_var != '' && isset($value)) {
|
||||||
(array)$this->_tpl_vars[$tpl_var][] = $value;
|
if(!is_array($this->_tpl_vars[$tpl_var])) {
|
||||||
|
settype($this->_tpl_vars[$tpl_var],'array');
|
||||||
|
}
|
||||||
|
$this->_tpl_vars[$tpl_var][] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->_extract = true;
|
$this->_extract = true;
|
||||||
|
Reference in New Issue
Block a user