Merge pull request #12060 from mikaelh/stable13

Actually return the root folder when traversing up the tree
This commit is contained in:
Morris Jobke 2018-10-26 11:02:50 +02:00 committed by GitHub
commit 9223159d42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -266,7 +266,11 @@ class Node implements \OCP\Files\Node {
* @return Node
*/
public function getParent() {
return $this->root->get(dirname($this->path));
$newPath = dirname($this->path);
if ($newPath === '' || $newPath === '.' || $newPath === '/') {
return $this->root;
}
return $this->root->get($newPath);
}
/**