cvs: smarty / Smarty.class.php
| From: | Monte Ohrt | Date: | Mon, 08 Jul 2002 14:58:51 +0000 |
| Subject: | cvs: smarty / Smarty.class.php | ||
| Groups: | php.smarty.cvs | ||
| Request: | Send a blank email to php-smarty-cvs+get-178@lists.php.net to get a copy of this message | ||
mohrt Mon Jul 8 10:58:51 2002 EDT
Modified files:
/smarty Smarty.class.php
Log:
cast var as an array, simplify and get rid of PHP warning messages
Index: smarty/Smarty.class.php
diff -u smarty/Smarty.class.php:1.297 smarty/Smarty.class.php:1.298
--- smarty/Smarty.class.php:1.297 Wed Jul 3 16:41:02 2002
+++ smarty/Smarty.class.php Mon Jul 8 10:58:51 2002
@@ -247,16 +247,12 @@
if (is_array($tpl_var)) {
foreach ($tpl_var as $key => $val) {
if (!empty($key)) {
- if (!is_array($this->_tpl_vars[$key]))
- settype($this->_tpl_vars[$key], 'array');
- $this->_tpl_vars[$key][] = $val;
+ (array)$this->_tpl_vars[$key][] = $val;
}
}
} else {
if (!empty($tpl_var) && isset($value)) {
- if (!is_array($this->_tpl_vars[$tpl_var]))
- settype($this->_tpl_vars[$tpl_var], 'array');
- $this->_tpl_vars[$tpl_var][] = $value;
+ (array)$this->_tpl_vars[$tpl_var][] = $value;
}
}
$this->_extract = true;