[VD:LocalFileSystem] fix #1022 Symbolic links are not visible

This commit is contained in:
nao-pon
2015-05-19 22:19:14 +09:00
parent 109191c937
commit 9ba35d0b3e
+4 -4
View File
@@ -169,7 +169,7 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
* @author Dmitry (dio) Levashov
**/
protected function _joinPath($dir, $name) {
return $dir.DIRECTORY_SEPARATOR.$name;
return rtrim($dir, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $name;
}
/**
@@ -239,7 +239,7 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
* @author Dmitry (dio) Levashov
**/
protected function _relpath($path) {
return $path == $this->root ? '' : substr($path, strlen($this->root)+1);
return $path == $this->root ? '' : substr($path, strlen(rtrim($this->root, DIRECTORY_SEPARATOR)) + 1);
}
/**
@@ -250,7 +250,7 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
* @author Dmitry (dio) Levashov
**/
protected function _abspath($path) {
return $path == DIRECTORY_SEPARATOR ? $this->root : $this->root.DIRECTORY_SEPARATOR.$path;
return $path == DIRECTORY_SEPARATOR ? $this->root : $this->_joinPath($this->root, $path);
}
/**
@@ -412,7 +412,7 @@ class elFinderVolumeLocalFileSystem extends elFinderVolumeDriver {
if ($this->_inpath($target, $this->aroot)) {
$atarget = realpath($target);
return $this->_normpath($this->root.DIRECTORY_SEPARATOR.substr($atarget, strlen($this->aroot)+1));
return $this->_normpath($this->_joinPath($this->root, substr($atarget, strlen(rtrim($this->aroot, DIRECTORY_SEPARATOR)) + 1)));
}
return false;