[VD:abstract,LocalFileSystem] fix #2035 support multipart rar extraction

This commit is contained in:
nao-pon
2017-06-02 15:45:04 +09:00
parent c4f59d857f
commit ee42f0689f
2 changed files with 37 additions and 23 deletions
+3 -3
View File
@@ -1005,7 +1005,7 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
if ($this->quarantine) {
$dir = $this->quarantine.DIRECTORY_SEPARATOR.md5(basename($path).mt_rand());
$archive = $dir.DIRECTORY_SEPARATOR.basename($path);
$archive = (isset($arc['toSpec']) || $arc['cmd'] === 'phpfunction')? '' : $dir.DIRECTORY_SEPARATOR.basename($path);
if (!mkdir($dir)) {
return false;
@@ -1017,12 +1017,12 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
chmod($dir, 0777);
// copy in quarantine
if (!copy($path, $archive)) {
if (!is_readable($path) || ($archive && !copy($path, $archive))) {
return false;
}
// extract in quarantine
$this->unpackArchive($archive, $arc);
$this->unpackArchive($path, $arc, $archive? true : $dir);
// get files list
$ls = self::localScandir($dir);