Skip to content

Commit

Permalink
[VD:LocalFileSystem] fix Studio-42#1494 support root path with drive …
Browse files Browse the repository at this point in the history
…letter
  • Loading branch information
nao-pon committed Jun 29, 2016
1 parent 4c1823c commit 2e9f5b3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion php/elFinderVolumeLocalFileSystem.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,11 @@ protected function _normpath($path) {

$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);
}

Expand Down Expand Up @@ -324,7 +329,7 @@ protected function _normpath($path) {
}

if ($changeSep) {
$path = str_replace('/', DIRECTORY_SEPARATOR, $path);
$path = $drive . str_replace('/', DIRECTORY_SEPARATOR, $path);
}

return $path ? $path : '.';
Expand Down

0 comments on commit 2e9f5b3

Please sign in to comment.