Merge pull request #55188 from nextcloud/backport/55183/stable31

[stable31] fix(trashbin): Translate Nextcloud exception to Sabre exception
This commit is contained in:
Joas Schilling 2025-09-19 15:39:16 +02:00 committed by GitHub
commit 869e45fbc2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,10 +9,16 @@ declare(strict_types=1);
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 {