Skip to content

Commit

Permalink
Pass OPTION_FORGIVING to VObject Reader
Browse files Browse the repository at this point in the history
  • Loading branch information
solracsf authored Oct 5, 2024
1 parent a6ff593 commit 4b8268b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/CalDAV/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -793,14 +793,14 @@ protected function validateICalendar(&$data, $path, &$modified, RequestInterface
// If the data starts with a [, we can reasonably assume we're dealing
// with a jCal object.
if ('[' === substr($data, 0, 1)) {
$vobj = VObject\Reader::readJson($data);
$vobj = VObject\Reader::readJson($data, VObject\Reader::OPTION_FORGIVING);

// Converting $data back to iCalendar, as that's what we
// technically support everywhere.
$data = $vobj->serialize();
$modified = true;
} else {
$vobj = VObject\Reader::read($data);
$vobj = VObject\Reader::read($data, VObject\Reader::OPTION_FORGIVING);
}
} catch (VObject\ParseException $e) {
throw new DAV\Exception\UnsupportedMediaType('This resource only supports valid iCalendar 2.0 data. Parse error: '.$e->getMessage());
Expand Down

0 comments on commit 4b8268b

Please sign in to comment.