Merge pull request #35087 from nextcloud/backport/35074/stable23

[stable23] Make sure that path is normalized and then checked,
This commit is contained in:
Joas Schilling 2022-11-11 15:53:14 +01:00 committed by GitHub
commit f152ec5d68
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -65,10 +65,11 @@ class Folder extends Node implements \OCP\Files\Folder {
* @throws \OCP\Files\NotPermittedException
*/
public function getFullPath($path) {
$path = $this->normalizePath($path);
if (!$this->isValidPath($path)) {
throw new NotPermittedException('Invalid path');
}
return $this->path . $this->normalizePath($path);
return $this->path . $path;
}
/**
@ -441,12 +442,12 @@ class Folder extends Node implements \OCP\Files\Folder {
return [$this->root->createNode(
$absolutePath, new \OC\Files\FileInfo(
$absolutePath,
$mount->getStorage(),
$cacheEntry->getPath(),
$cacheEntry,
$mount
))];
$absolutePath,
$mount->getStorage(),
$cacheEntry->getPath(),
$cacheEntry,
$mount
))];
}
public function getFreeSpace() {