mirror of
https://github.com/Studio-42/elFinder
synced 2026-06-08 12:37:09 +00:00
[VD:LocalFileSystem] check dir attr in _subdirs()
This commit is contained in:
@@ -543,6 +543,7 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
|
||||
**/
|
||||
protected function _subdirs($path) {
|
||||
|
||||
$dirs = false;
|
||||
if (is_dir($path)) {
|
||||
$dirItr = new ParentIterator(
|
||||
new RecursiveDirectoryIterator($path,
|
||||
@@ -552,9 +553,22 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
|
||||
)
|
||||
);
|
||||
$dirItr->rewind();
|
||||
return $dirItr->hasChildren();
|
||||
if ($dirItr->hasChildren()) {
|
||||
$dirs = true;
|
||||
$name = $dirItr->getSubPathName();
|
||||
while($name) {
|
||||
if (!$this->attr($path . DIRECTORY_SEPARATOR . $name, 'read', null, true)) {
|
||||
$dirs = false;
|
||||
$dirItr->next();
|
||||
$name = $dirItr->getSubPathName();
|
||||
continue;
|
||||
}
|
||||
$dirs = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return $dirs;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user