File tree 1 file changed +14
-13
lines changed
1 file changed +14
-13
lines changed Original file line number Diff line number Diff line change @@ -2988,20 +2988,21 @@ public function getDenormalizedData(string $calendarData): array {
2988
2988
$ classification = self ::CLASSIFICATION_PUBLIC ;
2989
2989
$ hasDTSTART = false ;
2990
2990
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 ;
3004
2993
}
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
+
3005
3006
}
3006
3007
if (!$ componentType ) {
3007
3008
throw new BadRequest ('Calendar objects must have a VJOURNAL, VEVENT or VTODO component ' );
You can’t perform that action at this time.
0 commit comments