From 0e9a9c38da13b6be6c33468b82185ea1b54829f7 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 17 Jan 2025 16:01:01 +0100 Subject: [PATCH] fix: use owner instead of current user for move-to-trash logic fixes #3496 Signed-off-by: Robin Appelman --- lib/Trash/TrashBackend.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Trash/TrashBackend.php b/lib/Trash/TrashBackend.php index e964815f5..6e82f8060 100644 --- a/lib/Trash/TrashBackend.php +++ b/lib/Trash/TrashBackend.php @@ -244,7 +244,8 @@ public function moveToTrash(IStorage $storage, string $internalPath): bool { // ensure the folder exists $this->getTrashFolder($folderId); - $trashFolder = $this->rootFolder->get('/' . $user->getUID() . '/files_trashbin/groupfolders/' . $folderId); + $owner = $storage->getOwner($internalPath); + $trashFolder = $this->rootFolder->get('/' . $owner . '/files_trashbin/groupfolders/' . $folderId); $trashStorage = $trashFolder->getStorage(); $time = time(); $trashName = $name . '.d' . $time;