cvs: smarty / Smarty.class.php

From: Date: Fri, 12 Jul 2002 15:20:18 +0000
Subject: cvs: smarty / Smarty.class.php
Groups: php.smarty.cvs 
Request: Send a blank email to php-smarty-cvs+get-187@lists.php.net to get a copy of this message
mohrt Fri Jul 12 11:20:18 2002 EDT Modified files: /smarty Smarty.class.php Log: fix append function with array/string issue Index: smarty/Smarty.class.php diff -u smarty/Smarty.class.php:1.301 smarty/Smarty.class.php:1.302 --- smarty/Smarty.class.php:1.301 Thu Jul 11 11:18:39 2002 +++ smarty/Smarty.class.php Fri Jul 12 11:20:15 2002 @@ -246,13 +246,19 @@ { if (is_array($tpl_var)) { foreach ($tpl_var as $key => $val) { - if (!empty($key)) { - (array)$this->_tpl_vars[$key][] = $val; + if ($key != '') { + if(!is_array($this->_tpl_vars[$key])) { + settype($this->_tpl_vars[$key],'array'); + } + $this->_tpl_vars[$key][] = $val; } } } else { - if (!empty($tpl_var) && isset($value)) { - (array)$this->_tpl_vars[$tpl_var][] = $value; + if ($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; } } $this->_extract = true;

« previous php.smarty.cvs (#187) next »