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 @@ -417,7 +417,7 @@ protected function readProperty($line)
417417 $ property ['value ' ] = $ match ['propValue ' ];
418418 continue ;
419419 }
420- if (isset ($ match ['name ' ]) && $ match ['name ' ]) {
420+ if (isset ($ match ['name ' ]) && 0 < strlen ( $ match ['name ' ]) ) {
421421 $ property ['name ' ] = strtoupper ($ match ['name ' ]);
422422 continue ;
423423 }
@@ -430,7 +430,7 @@ protected function readProperty($line)
430430 if (is_null ($ property ['value ' ])) {
431431 $ property ['value ' ] = '' ;
432432 }
433- if (!$ property ['name ' ]) {
433+ if (!isset ( $ property ['name ' ]) || 0 == strlen ( $ property [ ' name ' ]) ) {
434434 if ($ this ->options & self ::OPTION_IGNORE_INVALID_LINES ) {
435435 return false ;
436436 }
Original file line number Diff line number Diff line change @@ -263,4 +263,21 @@ public function provideBrokenVCalendar()
263263EOF
264264 ]];
265265 }
266+
267+ public function testPropertyName0 (): void
268+ {
269+ $ iCal = <<<EOF
270+ BEGIN:VCALENDAR
271+ VERSION:2.0
272+ PRODID:PRODID
273+ BEGIN:VEVENT
274+ 0:test
275+ END:VEVENT
276+ END:VCALENDAR
277+ EOF ;
278+
279+ $ mimeDir = new MimeDir ();
280+ $ vevent = $ mimeDir ->parse ($ iCal );
281+ self ::assertEquals ('test ' , $ vevent ->VEVENT ->{0 }->getValue ());
282+ }
266283}
You can’t perform that action at this time.
0 commit comments