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

Followup 12883, gracefully handle the getting of /
pull/13122/head
Roeland Jago Douma 7 years ago committed by GitHub
commit ea8120b1e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      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;

Loading…
Cancel
Save