mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
added check if for file_exists() to Smarty::_read_file()
This commit is contained in:
@@ -1704,9 +1704,9 @@ class Smarty
|
|||||||
*/
|
*/
|
||||||
function _read_file($filename)
|
function _read_file($filename)
|
||||||
{
|
{
|
||||||
if ($fd = @fopen($filename, 'rb')) {
|
if ( file_exists($filename) && ($fd = @fopen($filename, 'rb')) ) {
|
||||||
$contents = ($size = filesize($filename)) ? fread($fd, $size) : '';
|
$contents = ($size = filesize($filename)) ? fread($fd, $size) : '';
|
||||||
fclose($fd);
|
fclose($fd);
|
||||||
return $contents;
|
return $contents;
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user