mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Fix backport
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
This commit is contained in:
parent
7cb1ebacb9
commit
7ae086b63f
1 changed files with 5 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue