glob rather than readdir, sorts too

This commit is contained in:
Shish 2009-08-02 09:36:16 +01:00
parent f58fec3094
commit 62ba59a421

View File

@ -61,8 +61,7 @@ class BulkAdd extends SimpleExtension {
$list = ""; $list = "";
$dir = opendir("$base/$subdir"); foreach(glob("$base/$subdir/*") as $filename) {
while($filename = readdir($dir)) {
$fullpath = "$base/$subdir/$filename"; $fullpath = "$base/$subdir/$filename";
if(is_link($fullpath)) { if(is_link($fullpath)) {
@ -89,7 +88,6 @@ class BulkAdd extends SimpleExtension {
} }
} }
} }
closedir($dir);
if(strlen($list) > 0) { if(strlen($list) > 0) {
$this->theme->add_status("Adding $subdir", $list); $this->theme->add_status("Adding $subdir", $list);