Skip to content

Commit

Permalink
fix(trash): Fix deleting items from public share with write access
Browse files Browse the repository at this point in the history
When no user in session, use an empty string as deleted_by, which shows
 as "Unknown" in the UI.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
  • Loading branch information
come-nc authored and provokateurin committed Feb 18, 2025
1 parent e2b9e34 commit c20d1de
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/Trash/TrashBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,7 @@ public function moveToTrash(IStorage $storage, string $internalPath): bool {
$name = basename($internalPath);
$fileEntry = $storage->getCache()->get($internalPath);
$folderId = $storage->getFolderId();
$user = $this->userSession->getUser();
if (!$user) {
throw new \Exception("file moved to trash with no user in context");
}

// ensure the folder exists
$this->getTrashFolder($folderId);

Expand Down

0 comments on commit c20d1de

Please sign in to comment.