]> git.mjollnir.org Git - moodle.git/commitdiff
FIxed a logic bug when getting files ... bug 1305
authormoodler <moodler>
Tue, 4 May 2004 01:21:17 +0000 (01:21 +0000)
committermoodler <moodler>
Tue, 4 May 2004 01:21:17 +0000 (01:21 +0000)
lib/moodlelib.php

index 277b5556b46938cb8593a171420885605c9f1530..5c4d8383164ee80916ad030cf3f8c661ab049a9c 100644 (file)
@@ -1542,13 +1542,15 @@ function get_directory_list($rootdir, $excludefile="", $descend=true, $justdirs=
             continue;
         }
         $fullfile = "$rootdir/$file";
-        if ($descend and filetype($fullfile) == "dir") {
+        if (filetype($fullfile) == "dir") {
             if ($justdirs) {
                 $dirs[] = $file;
             }
-            $subdirs = get_directory_list($fullfile, $excludefile, $descend, $justdirs);
-            foreach ($subdirs as $subdir) {
-                $dirs[] = "$file/$subdir";
+            if ($descend) {
+                $subdirs = get_directory_list($fullfile, $excludefile, $descend, $justdirs);
+                foreach ($subdirs as $subdir) {
+                    $dirs[] = "$file/$subdir";
+                }
             }
         } else if (!$justdirs) {
             $dirs[] = $file;