mirror of
https://github.com/Studio-42/elFinder
synced 2026-06-08 12:37:09 +00:00
[VD:LocalFileSystem] fix #1494 support root path with drive letter
This commit is contained in:
@@ -285,6 +285,11 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
|
||||
|
||||
$changeSep = (DIRECTORY_SEPARATOR !== '/');
|
||||
if ($changeSep) {
|
||||
$drive = '';
|
||||
if (preg_match('/^([a-zA-Z]:)(.*)/', $path, $m)) {
|
||||
$drive = $m[1];
|
||||
$path = $m[2]? $m[2] : '/';
|
||||
}
|
||||
$path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
|
||||
}
|
||||
|
||||
@@ -324,7 +329,7 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
|
||||
}
|
||||
|
||||
if ($changeSep) {
|
||||
$path = str_replace('/', DIRECTORY_SEPARATOR, $path);
|
||||
$path = $drive . str_replace('/', DIRECTORY_SEPARATOR, $path);
|
||||
}
|
||||
|
||||
return $path ? $path : '.';
|
||||
|
||||
Reference in New Issue
Block a user