Add checks in opendir() to prevent including the current directory or parent
This commit is contained in:
parent
6b303ee64b
commit
b2b7d99302
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue