File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed
Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -415,7 +415,7 @@ protected function readProperty(string $line)
415415 $ property ['value ' ] = $ match ['propValue ' ];
416416 continue ;
417417 }
418- if (isset ($ match ['name ' ]) && $ match ['name ' ]) {
418+ if (isset ($ match ['name ' ]) && 0 < strlen ( $ match ['name ' ]) ) {
419419 $ property ['name ' ] = strtoupper ($ match ['name ' ]);
420420 continue ;
421421 }
@@ -428,7 +428,7 @@ protected function readProperty(string $line)
428428 if (\is_null ($ property ['value ' ])) {
429429 $ property ['value ' ] = '' ;
430430 }
431- if (!$ property ['name ' ]) {
431+ if (!isset ( $ property ['name ' ]) || 0 == strlen ( $ property [ ' name ' ]) ) {
432432 if ($ this ->options & self ::OPTION_IGNORE_INVALID_LINES ) {
433433 return false ;
434434 }
Original file line number Diff line number Diff line change @@ -259,4 +259,21 @@ public function provideBrokenVCalendar(): array
259259EOF ,
260260 ]];
261261 }
262+
263+ public function testPropertyName0 (): void
264+ {
265+ $ iCal = <<<EOF
266+ BEGIN:VCALENDAR
267+ VERSION:2.0
268+ PRODID:PRODID
269+ BEGIN:VEVENT
270+ 0:test
271+ END:VEVENT
272+ END:VCALENDAR
273+ EOF ;
274+
275+ $ mimeDir = new MimeDir ();
276+ $ vevent = $ mimeDir ->parse ($ iCal );
277+ self ::assertEquals ('test ' , $ vevent ->VEVENT ->{0 }->getValue ());
278+ }
262279}
You can’t perform that action at this time.
0 commit comments