[VD:LocalFileSystem] fix #1494 support root path with drive letter

This commit is contained in:
nao-pon
2016-06-29 09:20:38 +09:00
parent 4c1823ceed
commit 2e9f5b3f62
+6 -1
View File
@@ -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 : '.';