index bb51290079a7b5c8ded032a92f8a8756924e3180..47ec24efaa2bfbdd72c9a0e4bcf0c703addd46c3 100644 (file)
* @author Monte Ohrt <monte at ohrt dot com>
* @author Andrei Zmievski <andrei@php.net>
* @package Smarty
- * @version 2.6.9
+ * @version 2.6.14
*/
-/* $Id: Smarty.class.php,v 1.514 2005/03/22 08:45:06 messju Exp $ */
+/* $Id: Smarty.class.php,v 1.524 2006/01/18 19:02:52 mohrt Exp $ */
/**
* DIR_SEP isn't used anymore, but third party apps might
*
* @var string
*/
- var $_version = '2.6.9';
+ var $_version = '2.6.14';
/**
* current template inclusion depth
{
if(!isset($name)) {
return $this->_tpl_vars;
- }
- if(isset($this->_tpl_vars[$name])) {
+ } elseif(isset($this->_tpl_vars[$name])) {
return $this->_tpl_vars[$name];
+ } else {
+ // var non-existant, return valid reference
+ $_tmp = null;
+ return $_tmp;
}
}
return $this->_config[0]['vars'];
} else if(isset($this->_config[0]['vars'][$name])) {
return $this->_config[0]['vars'][$name];
+ } else {
+ // var non-existant, return valid reference
+ $_tmp = null;
+ return $_tmp;
}
}
*/
function _dequote($string)
{
- if (($string{0} == "'" || $string{0} == '"') &&
- $string{strlen($string)-1} == $string{0})
+ if ((substr($string, 0, 1) == "'" || substr($string, 0, 1) == '"') &&
+ substr($string, -1) == substr($string, 0, 1))
return substr($string, 1, -1);
else
return $string;
function _read_file($filename)
{
if ( file_exists($filename) && ($fd = @fopen($filename, 'rb')) ) {
- $contents = ($size = filesize($filename)) ? fread($fd, $size) : '';
+ $contents = '';
+ while (!feof($fd)) {
+ $contents .= fread($fd, 8192);
+ }
fclose($fd);
return $contents;
} else {
if ($this->_cache_including) {
/* return next set of cache_attrs */
- $_return =& current($_cache_attrs);
+ $_return = current($_cache_attrs);
next($_cache_attrs);
return $_return;