From f63cb7a54b98c55e36169b03ab2b70a96d1de46c Mon Sep 17 00:00:00 2001 From: messju Date: Tue, 4 May 2004 16:44:47 +0000 Subject: [PATCH] added check if for file_exists() to Smarty::_read_file() --- libs/Smarty.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 37203326..47cb2f24 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -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;