change tests in append and assign to != '' instead of empty(), which is more accurate

This commit is contained in:
mohrt
2002-07-09 01:18:00 +00:00
parent 405be3c1cd
commit 1be32cd188
3 changed files with 7 additions and 4 deletions

3
NEWS
View File

@@ -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 - allow $plugins_dir to be an array of directories
(Andreas Kossmeier, Monte) (Andreas Kossmeier, Monte)
- move debug.tpl to SMARTY_DIR, add to constructor (Monte) - move debug.tpl to SMARTY_DIR, add to constructor (Monte)

View File

@@ -226,12 +226,12 @@ 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) && isset($val)) { if ($key != '' && isset($val)) {
$this->_tpl_vars[$key] = $val; $this->_tpl_vars[$key] = $val;
} }
} }
} else { } else {
if (!empty($tpl_var) && isset($value)) if ($tpl_var != '' && isset($value))
$this->_tpl_vars[$tpl_var] = $value; $this->_tpl_vars[$tpl_var] = $value;
} }
$this->_extract = true; $this->_extract = true;

View File

@@ -226,12 +226,12 @@ 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) && isset($val)) { if ($key != '' && isset($val)) {
$this->_tpl_vars[$key] = $val; $this->_tpl_vars[$key] = $val;
} }
} }
} else { } else {
if (!empty($tpl_var) && isset($value)) if ($tpl_var != '' && isset($value))
$this->_tpl_vars[$tpl_var] = $value; $this->_tpl_vars[$tpl_var] = $value;
} }
$this->_extract = true; $this->_extract = true;