Skip to content

Commit a65cf51

Browse files
committed
fix(caldav): explicitly check from component types
Signed-off-by: Anna Larch <[email protected]>
1 parent f8dde2d commit a65cf51

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

Diff for: apps/dav/lib/CalDAV/CalDavBackend.php

+14-13
Original file line numberDiff line numberDiff line change
@@ -2988,20 +2988,21 @@ public function getDenormalizedData(string $calendarData): array {
29882988
$classification = self::CLASSIFICATION_PUBLIC;
29892989
$hasDTSTART = false;
29902990
foreach ($vObject->getComponents() as $component) {
2991-
if ($component->name !== 'VTIMEZONE') {
2992-
// Finding all VEVENTs, and track them
2993-
if ($component->name === 'VEVENT') {
2994-
$vEvents[] = $component;
2995-
if ($component->DTSTART) {
2996-
$hasDTSTART = true;
2997-
}
2998-
}
2999-
// Track first component type and uid
3000-
if ($uid === null) {
3001-
$componentType = $component->name;
3002-
$uid = (string)$component->UID;
3003-
}
2991+
if (!in_array($component->name, ['VEVENT', 'VJOURNAL', 'VTODO'])) {
2992+
continue;
30042993
}
2994+
2995+
$vEvents[] = $component;
2996+
if ($component->DTSTART) {
2997+
$hasDTSTART = true;
2998+
}
2999+
3000+
// Track first component type and uid
3001+
if ($uid === null) {
3002+
$componentType = $component->name;
3003+
$uid = (string)$component->UID;
3004+
}
3005+
30053006
}
30063007
if (!$componentType) {
30073008
throw new BadRequest('Calendar objects must have a VJOURNAL, VEVENT or VTODO component');

0 commit comments

Comments
 (0)