diff --git a/NEWS b/NEWS index d7422be1..eb4c294f 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,6 @@ + - change logic in assign() and append() to test var names + against != '' instead of empty() (Monte) + - fix PHP notice in append() function (Monte) - allow $plugins_dir to be an array of directories (Andreas Kossmeier, Monte) - move debug.tpl to SMARTY_DIR, add to constructor (Monte) diff --git a/Smarty.class.php b/Smarty.class.php index db86dab9..12bcab5f 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -226,12 +226,12 @@ class Smarty { if (is_array($tpl_var)){ foreach ($tpl_var as $key => $val) { - if (!empty($key) && isset($val)) { + if ($key != '' && isset($val)) { $this->_tpl_vars[$key] = $val; } } } else { - if (!empty($tpl_var) && isset($value)) + if ($tpl_var != '' && isset($value)) $this->_tpl_vars[$tpl_var] = $value; } $this->_extract = true; diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index db86dab9..12bcab5f 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -226,12 +226,12 @@ class Smarty { if (is_array($tpl_var)){ foreach ($tpl_var as $key => $val) { - if (!empty($key) && isset($val)) { + if ($key != '' && isset($val)) { $this->_tpl_vars[$key] = $val; } } } else { - if (!empty($tpl_var) && isset($value)) + if ($tpl_var != '' && isset($value)) $this->_tpl_vars[$tpl_var] = $value; } $this->_extract = true;