diff --git a/apps/files_trashbin/lib/Trashbin.php b/apps/files_trashbin/lib/Trashbin.php index 71f6a6918670a..a32e720533cd5 100644 --- a/apps/files_trashbin/lib/Trashbin.php +++ b/apps/files_trashbin/lib/Trashbin.php @@ -393,7 +393,9 @@ public static function move2trash($file_path, $ownerOnly = false) { 'timestamp' => $timestamp, ] ); - self::deleteTrashRow($user, $filename, $timestamp); + // The metadata row belongs to the owner, even when another user initiated + // the deletion. + self::deleteTrashRow($owner, $filename, $timestamp); if ($trashStorage->file_exists($trashInternalPath)) { if ($trashStorage->is_dir($trashInternalPath)) { $trashStorage->rmdir($trashInternalPath);