mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 03:14:27 +02:00
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:
1
NEWS
1
NEWS
@@ -1,3 +1,4 @@
|
|||||||
|
- make Smarty::_read_file() work on latest php (messju)
|
||||||
- fixed improper tokenization of certain inline math expressions (boots)
|
- fixed improper tokenization of certain inline math expressions (boots)
|
||||||
|
|
||||||
Version 2.6.11 (Dec 14, 2005)
|
Version 2.6.11 (Dec 14, 2005)
|
||||||
|
@@ -1715,7 +1715,10 @@ class Smarty
|
|||||||
function _read_file($filename)
|
function _read_file($filename)
|
||||||
{
|
{
|
||||||
if ( file_exists($filename) && ($fd = @fopen($filename, 'rb')) ) {
|
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);
|
fclose($fd);
|
||||||
return $contents;
|
return $contents;
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user