Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Fix backport
Signed-off-by: Git'Fellow <[email protected]>
  • Loading branch information
solracsf authored May 28, 2024
commit 91c1d0bf7e7147cb422d1b71d4c1e52e3e1448a3
5 changes: 5 additions & 0 deletions lib/private/Files/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,11 @@ public function deleteAll($directory) {
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)
Expand Down