Skip to content

Commit b90e8f0

Browse files
committed
fix(caldav): explicitly check from component types
Signed-off-by: Anna Larch <anna@nextcloud.com>
1 parent f8dde2d commit b90e8f0

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

apps/dav/lib/CalDAV/CalDavBackend.php

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2988,20 +2988,22 @@ 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+
$allowedCoponents = $this->propertyMap;
2992+
if(!in_array($component->name, ['VEVENT', 'VJOURNAL', 'VTODO'])) {
2993+
continue;
30042994
}
2995+
2996+
$vEvents[] = $component;
2997+
if ($component->DTSTART) {
2998+
$hasDTSTART = true;
2999+
}
3000+
3001+
// Track first component type and uid
3002+
if ($uid === null) {
3003+
$componentType = $component->name;
3004+
$uid = (string)$component->UID;
3005+
}
3006+
30053007
}
30063008
if (!$componentType) {
30073009
throw new BadRequest('Calendar objects must have a VJOURNAL, VEVENT or VTODO component');

0 commit comments

Comments
 (0)