Merge pull request #13210 from nextcloud/followup/12883/handle_slash
Followup 12883, gracefully handle the getting of /
This commit is contained in:
commit
ea8120b1e4
1 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue