cvs: smarty /libs Smarty.class.php

"Messju Mohr" <[email protected]>
Newsgroups gmane.comp.php.cvs.smarty
Message-ID <cvsmessju1083689087@cvsserver>
messju		Tue May  4 12:44:47 2004 EDT

  Modified files:              
    /smarty/libs	Smarty.class.php 
  Log:
  added check if for file_exists() to Smarty::_read_file()
  
  
  
http://cvs.php.net/diff.php/smarty/libs/Smarty.class.php?r1=1.487&r2=1.488&ty=u
Index: smarty/libs/Smarty.class.php
diff -u smarty/libs/Smarty.class.php:1.487 smarty/libs/Smarty.class.php:1.488
--- smarty/libs/Smarty.class.php:1.487	Fri Apr 16 04:06:40 2004
+++ smarty/libs/Smarty.class.php	Tue May  4 12:44:47 2004
@@ -30,7 +30,7 @@
  * @version 2.6.3-dev
  */
 
-/* $Id: Smarty.class.php,v 1.487 2004/04/16 08:06:40 messju Exp $ */
+/* $Id: Smarty.class.php,v 1.488 2004/05/04 16:44:47 messju Exp $ */
 
 /**
  * DIR_SEP isn't used anymore, but third party apps might
@@ -1704,9 +1704,9 @@
      */
     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;

-- 
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.