mirror of
https://github.com/Studio-42/elFinder
synced 2026-06-08 12:37:09 +00:00
[php] use opendir() instead to scandir()
Reson is PHP function scandir() is not work well in specific environment. I dont know why. Maybe fixes #1241, fixes #1247, fixes #1248
This commit is contained in:
@@ -948,20 +948,18 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
|
||||
}
|
||||
|
||||
if (is_dir($path)) {
|
||||
foreach (scandir($path) as $name) {
|
||||
if ($name != '.' && $name != '..') {
|
||||
$p = $path.DIRECTORY_SEPARATOR.$name;
|
||||
if (is_link($p) || !$this->nameAccepted($name)
|
||||
||
|
||||
(($mimeByName = elFinderVolumeDriver::mimetypeInternalDetect($name)) && $mimeByName !== 'unknown' && !$this->allowPutMime($mimeByName))) {
|
||||
$this->setError(elFinder::ERROR_SAVE, $name);
|
||||
return true;
|
||||
}
|
||||
if (is_dir($p) && $this->_findSymlinks($p)) {
|
||||
return true;
|
||||
} elseif (is_file($p)) {
|
||||
$this->archiveSize += sprintf('%u', filesize($p));
|
||||
}
|
||||
foreach (self::localScandir($path) as $name) {
|
||||
$p = $path.DIRECTORY_SEPARATOR.$name;
|
||||
if (is_link($p) || !$this->nameAccepted($name)
|
||||
||
|
||||
(($mimeByName = elFinderVolumeDriver::mimetypeInternalDetect($name)) && $mimeByName !== 'unknown' && !$this->allowPutMime($mimeByName))) {
|
||||
$this->setError(elFinder::ERROR_SAVE, $name);
|
||||
return true;
|
||||
}
|
||||
if (is_dir($p) && $this->_findSymlinks($p)) {
|
||||
return true;
|
||||
} elseif (is_file($p)) {
|
||||
$this->archiveSize += sprintf('%u', filesize($p));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -1006,12 +1004,7 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
|
||||
$this->unpackArchive($archive, $arc);
|
||||
|
||||
// get files list
|
||||
$ls = array();
|
||||
foreach (scandir($dir) as $i => $name) {
|
||||
if ($name != '.' && $name != '..') {
|
||||
$ls[] = $name;
|
||||
}
|
||||
}
|
||||
$ls = self::localScandir($dir);
|
||||
|
||||
// no files - extract error ?
|
||||
if (empty($ls)) {
|
||||
|
||||
Reference in New Issue
Block a user