Make sure that path is normalized and then checked,

and not the other way around

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/35074/head
Côme Chilliet 2022-11-10 15:03:15 +07:00
parent cfa291ec8f
commit a78595a45f
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
1 changed files with 8 additions and 7 deletions

@ -66,10 +66,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;
}
/**
@ -371,12 +372,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() {