Fix backport

Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
This commit is contained in:
Git'Fellow 2024-05-27 19:21:03 +02:00 committed by GitHub
parent 7cb1ebacb9
commit 7ae086b63f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -732,6 +732,11 @@ class View {
public function rename($source, $target) {
$absolutePath1 = Filesystem::normalizePath($this->getAbsolutePath($source));
$absolutePath2 = Filesystem::normalizePath($this->getAbsolutePath($target));
if (str_starts_with($absolutePath2, $absolutePath1 . '/')) {
throw new ForbiddenException("Moving a folder into a child folder is forbidden", false);
}
$result = false;
if (
Filesystem::isValidPath($target)