mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
fix(caldav): Throw 403 Forbidden Error instead of 500 Internal Server Error
Signed-off-by: SebastianKrupinski <krupinskis05@gmail.com>
This commit is contained in:
parent
718ef5dea5
commit
0f3d05afea
1 changed files with 10 additions and 1 deletions
|
|
@ -65,6 +65,7 @@ use Sabre\VObject\ParseException;
|
|||
use Sabre\VObject\Property;
|
||||
use Sabre\VObject\Reader;
|
||||
use Sabre\VObject\Recur\EventIterator;
|
||||
use Sabre\VObject\Recur\NoInstancesException;
|
||||
use function array_column;
|
||||
use function array_map;
|
||||
use function array_merge;
|
||||
|
|
@ -2987,7 +2988,15 @@ class CalDavBackend extends AbstractBackend implements SyncSupport, Subscription
|
|||
$lastOccurrence = $firstOccurrence;
|
||||
}
|
||||
} else {
|
||||
$it = new EventIterator($vEvents);
|
||||
try {
|
||||
$it = new EventIterator($vEvents);
|
||||
} catch (NoInstancesException $e) {
|
||||
$this->logger->debug('Caught no instance exception for calendar data. This usually indicates invalid calendar data.', [
|
||||
'app' => 'dav',
|
||||
'exception' => $e,
|
||||
]);
|
||||
throw new Forbidden($e->getMessage());
|
||||
}
|
||||
$maxDate = new DateTime(self::MAX_DATE);
|
||||
$firstOccurrence = $it->getDtStart()->getTimestamp();
|
||||
if ($it->isInfinite()) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue