Merge pull request #13210 from nextcloud/followup/12883/handle_slash

Followup 12883, gracefully handle the getting of /
This commit is contained in:
Roeland Jago Douma 2018-12-21 14:23:13 +01:00 committed by GitHub
commit ea8120b1e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;