Skip to content

Commit 4ac49eb

Browse files
Merge pull request #3543 from nextcloud/trash-use-owner
fix: use owner instead of current user for move-to-trash logic
2 parents 4564526 + 0e9a9c3 commit 4ac49eb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/Trash/TrashBackend.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ public function moveToTrash(IStorage $storage, string $internalPath): bool {
243243
// ensure the folder exists
244244
$this->getTrashFolder($folderId);
245245

246-
$trashFolder = $this->rootFolder->get('/' . $user->getUID() . '/files_trashbin/groupfolders/' . $folderId);
246+
$owner = $storage->getOwner($internalPath);
247+
$trashFolder = $this->rootFolder->get('/' . $owner . '/files_trashbin/groupfolders/' . $folderId);
247248
$trashStorage = $trashFolder->getStorage();
248249
$time = time();
249250
$trashName = $name . '.d' . $time;

0 commit comments

Comments
 (0)