summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-04-27 13:59:29 +0200
committerGitHub <noreply@github.com>2018-04-27 13:59:29 +0200
commit7306d30708ae72dc5f9b2251eeb903bcfe58fd41 (patch)
tree4bbc77385aca6f9198f18219fbba081d27955172 /lib
parent21da3594f63634d312300dacfa17d62632a2d2a9 (diff)
parent235e3480e651790feb63b904945db2dd352a4bde (diff)
downloadnextcloud-server-7306d30708ae72dc5f9b2251eeb903bcfe58fd41.tar.gz
nextcloud-server-7306d30708ae72dc5f9b2251eeb903bcfe58fd41.zip
Merge pull request #9321 from nextcloud/bugfix/noid/return_root_folder_when_at_root
Actually return the root folder when traversing up the tree
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Files/Node/Node.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/Files/Node/Node.php b/lib/private/Files/Node/Node.php
index 304b2ccf464..d2232624b9b 100644
--- a/lib/private/Files/Node/Node.php
+++ b/lib/private/Files/Node/Node.php
@@ -265,7 +265,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);
}
/**