added check if for file_exists() to Smarty::_read_file()

This commit is contained in:
messju
2004-05-04 16:44:47 +00:00
parent 9654232a24
commit f63cb7a54b

View File

@@ -1704,9 +1704,9 @@ class Smarty
*/
function _read_file($filename)
{
if ($fd = @fopen($filename, 'rb')) {
if ( file_exists($filename) && ($fd = @fopen($filename, 'rb')) ) {
$contents = ($size = filesize($filename)) ? fread($fd, $size) : '';
fclose($fd);
fclose($fd);
return $contents;
} else {
return false;