src build elFinder-2.1-2f71112

This commit is contained in:
nao-pon
2020-03-05 23:31:15 +09:00
parent 8b45865e47
commit dce7e7639e
5 changed files with 34 additions and 20 deletions
+28 -14
View File
@@ -831,33 +831,47 @@ class elFinderVolumeFTP extends elFinderVolumeDriver
$res = array(
'name' => $this->root,
'mime' => 'directory',
'dirs' => $this->_subdirs($path)
'dirs' => -1
);
if ($this->isMyReload()) {
if ($this->needOnline && (($this->ARGS['cmd'] === 'open' && $this->ARGS['target'] === $this->encode($this->root)) || $this->isMyReload())) {
$check = array(
'ts' => true,
'dirs' => true,
);
$ts = 0;
foreach ($this->ftpRawList($path) as $str) {
if (($stat = $this->parseRaw($str, $path))) {
if (!empty($stat['ts'])) {
$info = preg_split('/\s+/', $str, 9);
if ($info[8] === '.') {
$info[8] = 'root';
if ($stat = $this->parseRaw(join(' ', $info), $path)) {
unset($stat['name']);
$res = array_merge($res, $stat);
if ($res['ts']) {
$ts = 0;
unset($check['ts']);
}
}
}
if ($check && ($stat = $this->parseRaw($str, $path))) {
if (isset($stat['ts']) && !empty($stat['ts'])) {
$ts = max($ts, $stat['ts']);
}
if (isset($stat['dirs']) && $stat['mime'] === 'directory') {
$res['dirs'] = 1;
unset($stat['dirs']);
}
if (!$check) {
break;
}
}
}
if ($ts) {
$res['ts'] = $ts;
}
$this->cache[$outPath] = $res;
}
return $res;
}
// stat of system root
if ($path === $this->separator) {
$res = array(
'name' => $this->separator,
'mime' => 'directory',
'dirs' => 1
);
$this->cache[$outPath] = $res;
return $res;
}
$pPath = $this->_dirname($path);
if ($this->_inPath($pPath, $this->root)) {