[VD:LocalFileSystem] check dir attr in _subdirs()

This commit is contained in:
nao-pon
2016-01-13 18:03:11 +09:00
parent 68308b95f1
commit 0b9c4cb08e
+16 -2
View File
@@ -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;
}
/**