mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
FIxed a logic bug when getting files ... bug 1305
This commit is contained in:
parent
d37b85b38b
commit
bf5c2e8445
@ -1542,14 +1542,16 @@ function get_directory_list($rootdir, $excludefile="", $descend=true, $justdirs=
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$fullfile = "$rootdir/$file";
|
$fullfile = "$rootdir/$file";
|
||||||
if ($descend and filetype($fullfile) == "dir") {
|
if (filetype($fullfile) == "dir") {
|
||||||
if ($justdirs) {
|
if ($justdirs) {
|
||||||
$dirs[] = $file;
|
$dirs[] = $file;
|
||||||
}
|
}
|
||||||
|
if ($descend) {
|
||||||
$subdirs = get_directory_list($fullfile, $excludefile, $descend, $justdirs);
|
$subdirs = get_directory_list($fullfile, $excludefile, $descend, $justdirs);
|
||||||
foreach ($subdirs as $subdir) {
|
foreach ($subdirs as $subdir) {
|
||||||
$dirs[] = "$file/$subdir";
|
$dirs[] = "$file/$subdir";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else if (!$justdirs) {
|
} else if (!$justdirs) {
|
||||||
$dirs[] = $file;
|
$dirs[] = $file;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user