Switch to scandir.

This commit is contained in:
Lars Jung 2014-09-24 15:17:16 +02:00
parent 18a6f20390
commit 0cfc9a0eaa

View file

@ -118,18 +118,15 @@ class App {
$names = array(); $names = array();
if (is_dir($path)) { if (is_dir($path)) {
if ($dir = opendir($path)) { foreach (scandir($path) as $name) {
while (($name = readdir($dir)) !== false) { if (
if ( $this->is_hidden($name)
$this->is_hidden($name) || $this->is_hidden($this->to_url($path) . $name)
|| $this->is_hidden($this->to_url($path) . $name) || (!is_readable($path .'/'. $name) && $this->options["view"]["hideIf403"])
|| (!is_readable($path .'/'. $name) && $this->options["view"]["hideIf403"]) ) {
) { continue;
continue;
}
$names[] = $name;
} }
closedir($dir); $names[] = $name;
} }
} }
return $names; return $names;