dav
dav copied to clipboard
getMultipleCalendarObjects default implementation does not allow for null values from getCalendarObject
https://github.com/sabre-io/dav/blob/22dbd3ff0f152f65e49e2ecf6f87d2b144ab9a81/lib/CalDAV/Backend/AbstractBackend.php#L53
If a client thinks it knows a objectUri but it somehow does not exist on the server anymore, it may include this objectUri in a calendar-multiget request. Since the default getMultipleCalendarObjects implementation does not allow for null values from getCalendarObject to be skipped, this will result in a fatal error in the constructor of \Sabre\CalDAV\CalendarObject
This could be fixed by replacing the array_map with:
public function getMultipleCalendarObjects($calendarId, array $uris) {
$ret = [];
foreach ($uris as $uri) {
if ($array = $this->getCalendarObject($calendarId, $uri)) {
$ret[] = $array;
}
}
return $ret;
}