fixed incompatible use of fread() in Smarty::_read_file()

it choke on php-5.1.1 and later.
thanks to andig for pointing this out.
This commit is contained in:
messju
2005-12-31 19:17:05 +00:00
parent 4623c56762
commit 3079a7510f
2 changed files with 5 additions and 1 deletions

1
NEWS
View File

@@ -1,3 +1,4 @@
- make Smarty::_read_file() work on latest php (messju)
- fixed improper tokenization of certain inline math expressions (boots)
Version 2.6.11 (Dec 14, 2005)

View File

@@ -1715,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 {