src build elFinder-2.1-779a0ab

This commit is contained in:
nao-pon
2017-06-10 00:01:02 +09:00
parent 6bd6d46b03
commit b0484bcedf
10 changed files with 266 additions and 147 deletions
+22 -8
View File
@@ -4169,25 +4169,39 @@ abstract class elFinderVolumeDriver {
elFinder::extendTimeLimit();
$result = array('size' => 0, 'files' => 0, 'dirs' => 0);
$stat = $this->stat($path);
if (empty($stat) || !$stat['read'] || !empty($stat['hidden'])) {
return 'unknown';
$result['size'] = 'unknown';
return $result;
}
if ($stat['mime'] != 'directory') {
return $stat['size'];
$result['size'] = intval($stat['size']);
$result['files'] = 1;
return $result;
}
$subdirs = $this->options['checkSubfolders'];
$this->options['checkSubfolders'] = true;
$result = 0;
foreach ($this->getScandir($path) as $stat) {
$size = $stat['mime'] == 'directory' && $stat['read']
if ($isDir = ($stat['mime'] === 'directory' && $stat['read'])) {
++$result['dirs'];
} else {
++$result['files'];
}
$res = $isDir
? $this->countSize($this->decode($stat['hash']))
: (isset($stat['size']) ? intval($stat['size']) : 0);
if ($size > 0) {
$result += $size;
: (isset($stat['size']) ? array('size' => intval($stat['size'])) : array());
if (! empty($res['size']) && is_numeric($res['size'])) {
$result['size'] += $res['size'];
}
if (! empty($res['files']) && is_numeric($res['files'])) {
$result['files'] += $res['files'];
}
if (! empty($res['dirs']) && is_numeric($res['dirs'])) {
$result['dirs'] += $res['dirs'];
}
}
$this->options['checkSubfolders'] = $subdirs;
@@ -4586,7 +4600,7 @@ abstract class elFinderVolumeDriver {
return $this->setError(elFinder::ERROR_UPLOAD_FILE_MIME, $errpath);
}
if (($dim = $volume->dimensions($src))) {
if (strpos($source['mime'], 'image') === 0 && ($dim = $volume->dimensions($src))) {
$s = explode('x', $dim);
$source['width'] = $s[0];
$source['height'] = $s[1];