]> git.mjollnir.org Git - moodle.git/commitdiff
Check for existence of directory as well to avoid PHP warnings
authormoodler <moodler>
Sun, 17 Aug 2003 14:16:08 +0000 (14:16 +0000)
committermoodler <moodler>
Sun, 17 Aug 2003 14:16:08 +0000 (14:16 +0000)
lib/moodlelib.php

index 59bbc4549d3cbdd996977304fed1245b4515750e..937556af4e454dcf88324ef6742460762b5cd265 100644 (file)
@@ -1064,6 +1064,10 @@ function get_directory_list($rootdir, $excludefile="", $descend=true) {
 
     $dirs = array();
 
+    if (!is_dir($rootdir)) {
+        return $dirs;
+    }
+
     if (!$dir = opendir($rootdir)) {
         return $dirs;
     }