[Fusionforge-commits] r10624 - branches/Branch_5_0/gforge/www/admin

Olivier Berger olberger at libremir.placard.fr.eu.org
Wed Sep 22 15:00:10 CEST 2010


Author: olberger
Date: 2010-09-22 15:00:07 +0200 (Wed, 22 Sep 2010)
New Revision: 10624

Modified:
   branches/Branch_5_0/gforge/www/admin/pluginman.php
Log:
Handle missing plugins topdir (for instance /usr/share/gforge/plugins/)

It may be wise to check all opendir() return codes (unit tests ?)


Modified: branches/Branch_5_0/gforge/www/admin/pluginman.php
===================================================================
--- branches/Branch_5_0/gforge/www/admin/pluginman.php	2010-09-22 11:26:28 UTC (rev 10623)
+++ branches/Branch_5_0/gforge/www/admin/pluginman.php	2010-09-22 13:00:07 UTC (rev 10624)
@@ -205,18 +205,18 @@
 
 //get the directories from the plugins dir
 
-$handle = opendir($sys_plugins_path);
 $filelist = array();
-while (($filename = readdir($handle)) !== false) {
-	if ($filename!='..' && $filename!='.' && $filename!=".svn" && $filename!="CVS" &&
-		is_dir($sys_plugins_path.'/'.$filename) &&
-		!in_array($filename, $plugins_disabled)) {
+if($handle = opendir($sys_plugins_path)) {
+	while (($filename = readdir($handle)) !== false) {
+		if ($filename!='..' && $filename!='.' && $filename!=".svn" && $filename!="CVS" &&
+		    is_dir($sys_plugins_path.'/'.$filename) &&
+		    !in_array($filename, $plugins_disabled)) {
 
-		$filelist[] = $filename;
+			$filelist[] = $filename;
+		}
 	}
+	closedir($handle);
 }
-closedir($handle);
-
 sort($filelist);
 
 $j = 0;




More information about the Fusionforge-commits mailing list