mirror of
https://github.com/Studio-42/elFinder
synced 2026-06-08 12:37:09 +00:00
[VD:LocalFileSystem] fix #1127 autodetection of systemRoot
Volume driver option `path` supported Windows absolute path.
This commit is contained in:
@@ -59,7 +59,20 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->root = $this->getFullPath($this->root, getcwd());
|
||||
if (!$cwd = getcwd()) {
|
||||
return $this->setError('elFinder LocalVolumeDriver requires a result of getcwd().');
|
||||
}
|
||||
// detect systemRoot
|
||||
if (!isset($this->options['systemRoot'])) {
|
||||
if ($cwd[0] === $this->separator || $this->root[0] === $this->separator) {
|
||||
$this->systemRoot = $this->separator;
|
||||
} else if (preg_match('/^([a-zA-Z]:'.preg_quote($this->separator, '/').')/', $this->root, $m)) {
|
||||
$this->systemRoot = $m[1];
|
||||
} else if (preg_match('/^([a-zA-Z]:'.preg_quote($this->separator, '/').')/', $cwd, $m)) {
|
||||
$this->systemRoot = $m[1];
|
||||
}
|
||||
}
|
||||
$this->root = $this->getFullPath($this->root, $cwd);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user