summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2018-12-21 14:23:13 +0100
committerGitHub <noreply@github.com>2018-12-21 14:23:13 +0100
commitea8120b1e43b1732618c779c476d42efd05be2cf (patch)
treef17c939bdd27945dfd4d517e49b8f132182ed0d5
parentbcea6c3697aacf88b471f7bc54c3005319759b2a (diff)
parentd0956c9a4213d93674355e6fb7d7b0e9e0adfbdf (diff)
downloadnextcloud-server-ea8120b1e43b1732618c779c476d42efd05be2cf.tar.gz
nextcloud-server-ea8120b1e43b1732618c779c476d42efd05be2cf.zip
Merge pull request #13210 from nextcloud/followup/12883/handle_slash
Followup 12883, gracefully handle the getting of /
-rw-r--r--lib/private/Files/AppData/AppData.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/Files/AppData/AppData.php b/lib/private/Files/AppData/AppData.php
index 3d098ad98ca..7ce29bd0e00 100644
--- a/lib/private/Files/AppData/AppData.php
+++ b/lib/private/Files/AppData/AppData.php
@@ -132,8 +132,13 @@ class AppData implements IAppData {
}
}
try {
- $path = $this->getAppDataFolderName() . '/' . $this->appId . '/' . $name;
- $node = $this->rootFolder->get($path);
+ // Hardening if somebody wants to retrieve '/'
+ if ($name === '/') {
+ $node = $this->getAppDataFolder();
+ } else {
+ $path = $this->getAppDataFolderName() . '/' . $this->appId . '/' . $name;
+ $node = $this->rootFolder->get($path);
+ }
} catch (NotFoundException $e) {
$this->folders->set($key, $e);
throw $e;