From 1be32cd188cb95a3897c07f89a04d3197e44ee3f Mon Sep 17 00:00:00 2001 From: mohrt Date: Tue, 9 Jul 2002 01:18:00 +0000 Subject: [PATCH] change tests in append and assign to != '' instead of empty(), which is more accurate --- NEWS | 3 +++ Smarty.class.php | 4 ++-- libs/Smarty.class.php | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) 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;