fix some minor problems with path noramlization
This commit is contained in:
parent
0c8ce0bb32
commit
1522f7f211
|
@ -503,7 +503,7 @@ class OC_Filesystem{
|
|||
$path='/'.$path;
|
||||
}
|
||||
//remove trainling slash
|
||||
if(substr($path,-1,1)==='/'){
|
||||
if(strlen($path)>1 and substr($path,-1,1)==='/'){
|
||||
$path=substr($path,0,-1);
|
||||
}
|
||||
//remove duplicate slashes
|
||||
|
|
|
@ -103,7 +103,12 @@ class OC_FilesystemView {
|
|||
if(strpos($path, $this->fakeRoot)!==0) {
|
||||
return null;
|
||||
}else{
|
||||
return substr($path, strlen($this->fakeRoot));
|
||||
$path=substr($path, strlen($this->fakeRoot));
|
||||
if(strlen($path)===0){
|
||||
return '/';
|
||||
}else{
|
||||
return $path;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue