Add checks in opendir() to prevent including the current directory or parent

This commit is contained in:
Michael Gapczynski 2011-07-12 18:22:59 -04:00
parent 6b303ee64b
commit b2b7d99302
1 changed files with 6 additions and 4 deletions

View File

@ -98,10 +98,12 @@ class OC_FILESTORAGE_SHARED extends OC_FILESTORAGE {
$targets[] = basename($item['target']);
}
while (($filename = readdir($dh)) !== false) {
if (!in_array($filename, $sources)) {
$files[] = $filename;
} else {
$files[] = $targets[array_search($filename, $sources)];
if ($filename != "." && $filename != "..") {
if (!in_array($filename, $sources)) {
$files[] = $filename;
} else {
$files[] = $targets[array_search($filename, $sources)];
}
}
}
$FAKEDIRS['shared'] = $files;