Skip to content

Commit 80ffd83

Browse files
Merge pull request #63070 from nextcloud/jtr/fix-trashbin-move2file-failureCleanup-db
fix(files_trashbin): cleanup trash metadata after failed cross-user moves
2 parents fc87c7c + 04807f8 commit 80ffd83

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

apps/files_trashbin/lib/Trashbin.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,9 @@ public static function move2trash($file_path, $ownerOnly = false) {
391391
'timestamp' => $timestamp,
392392
]
393393
);
394-
self::deleteTrashRow($user, $filename, $timestamp);
394+
// The metadata row belongs to the owner, even when another user initiated
395+
// the deletion.
396+
self::deleteTrashRow($owner, $filename, $timestamp);
395397
if ($trashStorage->file_exists($trashInternalPath)) {
396398
if ($trashStorage->is_dir($trashInternalPath)) {
397399
$trashStorage->rmdir($trashInternalPath);

0 commit comments

Comments
 (0)