diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-10-26 11:02:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-26 11:02:50 +0200 |
commit | 9223159d420002bced75e8edbd48eb370ec16ac8 (patch) | |
tree | 5daa7e32273b0f8679af57c965582d6f0880da7f | |
parent | ae061c69f1bf1e4196a13ed9de88c6c438bce01c (diff) | |
parent | d8a581e4260cffe748c2da19959d80949ab57a83 (diff) | |
download | nextcloud-server-9223159d420002bced75e8edbd48eb370ec16ac8.tar.gz nextcloud-server-9223159d420002bced75e8edbd48eb370ec16ac8.zip |
Merge pull request #12060 from mikaelh/stable13
Actually return the root folder when traversing up the tree
-rw-r--r-- | lib/private/Files/Node/Node.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Files/Node/Node.php b/lib/private/Files/Node/Node.php index e00debe6903..f01d2421d16 100644 --- a/lib/private/Files/Node/Node.php +++ b/lib/private/Files/Node/Node.php @@ -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); } /** |