X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=include%2Fsmarty%2FSmarty.class.php;h=47ec24efaa2bfbdd72c9a0e4bcf0c703addd46c3;hb=c242a2a4abbf1e575421165a421f06fad6b79789;hp=bb51290079a7b5c8ded032a92f8a8756924e3180;hpb=c2c6a6e54355a1b67c25bb4d761d847513810d02;p=gosa.git diff --git a/include/smarty/Smarty.class.php b/include/smarty/Smarty.class.php index bb5129007..47ec24efa 100644 --- a/include/smarty/Smarty.class.php +++ b/include/smarty/Smarty.class.php @@ -27,10 +27,10 @@ * @author Monte Ohrt * @author Andrei Zmievski * @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 @@ -464,7 +464,7 @@ class Smarty * * @var string */ - var $_version = '2.6.9'; + var $_version = '2.6.14'; /** * current template inclusion depth @@ -1055,9 +1055,12 @@ class Smarty { 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; } } @@ -1074,6 +1077,10 @@ class Smarty 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; } } @@ -1691,8 +1698,8 @@ class Smarty */ 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; @@ -1708,7 +1715,10 @@ class Smarty 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 { @@ -1889,7 +1899,7 @@ class Smarty if ($this->_cache_including) { /* return next set of cache_attrs */ - $_return =& current($_cache_attrs); + $_return = current($_cache_attrs); next($_cache_attrs); return $_return;