[Fusionforge-commits] r9654 - trunk/gforge/common/include

Christian Bayle cbayle at libremir.placard.fr.eu.org
Thu Apr 29 21:57:52 CEST 2010


Author: cbayle
Date: 2010-04-29 21:57:51 +0200 (Thu, 29 Apr 2010)
New Revision: 9654

Modified:
   trunk/gforge/common/include/config.php
Log:
don't try to open dir that don't exist


Modified: trunk/gforge/common/include/config.php
===================================================================
--- trunk/gforge/common/include/config.php	2010-04-29 17:49:09 UTC (rev 9653)
+++ trunk/gforge/common/include/config.php	2010-04-29 19:57:51 UTC (rev 9654)
@@ -138,17 +138,18 @@
 	
 	$files = array () ;
 	
-	if ($handle = opendir($path)) {
-		while (false !== ($file = readdir($handle))) {
-			if ($file != "." 
-			    && $file != ".."
-			    // Avoid .bak, .old, .dpkg-old and so on
-			    && preg_match ('/^[0-9a-zA-Z_-]+$/', $file)) {
-				$files[] = "$path/$file" ;
+	if (is_dir($path)){
+		if ($handle = opendir($path)) {
+			while (false !== ($file = readdir($handle))) {
+				if ($file != "." 
+			    	&& $file != ".."
+			    	// Avoid .bak, .old, .dpkg-old and so on
+			    	&& preg_match ('/^[0-9a-zA-Z_-]+$/', $file)) {
+					$files[] = "$path/$file" ;
+				}
 			}
+			closedir($handle);
 		}
-		
-		closedir($handle);
 	}
 
 	natsort ($files) ;




More information about the Fusionforge-commits mailing list