Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(trashbin): Translate Nextcloud exception to Sabre exception
Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen authored and backportbot[bot] committed Sep 19, 2025
commit 722d4b452fdb74eedfb445ab01592efc530ccf1e
8 changes: 7 additions & 1 deletion apps/files_trashbin/lib/Sabre/TrashFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@
namespace OCA\Files_Trashbin\Sabre;

use OCA\Files_Trashbin\Trashbin;
use OCP\Files\ForbiddenException;
use Sabre\DAV\Exception\Forbidden;

class TrashFile extends AbstractTrashFile {
public function get() {
return $this->data->getStorage()->fopen(Trashbin::getTrashFilename($this->data->getInternalPath(), $this->getDeletionTime()), 'rb');
try {
return $this->data->getStorage()->fopen(Trashbin::getTrashFilename($this->data->getInternalPath(), $this->getDeletionTime()), 'rb');
} catch (ForbiddenException) {
throw new Forbidden();
}
}

public function getName(): string {
Expand Down
Loading