Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/Parser/MimeDir.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,7 @@ protected function readProperty($line)
$property['value'] = $match['propValue'];
continue;
}
if (isset($match['name']) && $match['name']) {
if (isset($match['name']) && 0 < strlen($match['name'])) {
$property['name'] = strtoupper($match['name']);
continue;
}
Expand All @@ -430,7 +430,7 @@ protected function readProperty($line)
if (is_null($property['value'])) {
$property['value'] = '';
}
if (!$property['name']) {
if (!isset($property['name']) || 0 == strlen($property['name'])) {
if ($this->options & self::OPTION_IGNORE_INVALID_LINES) {
return false;
}
Expand Down
17 changes: 17 additions & 0 deletions tests/VObject/Parser/MimeDirTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,21 @@ public function provideBrokenVCalendar()
EOF
]];
}

public function testPropertyName0(): void
{
$iCal = <<<EOF
BEGIN:VCALENDAR
VERSION:2.0
PRODID:PRODID
BEGIN:VEVENT
0:test
END:VEVENT
END:VCALENDAR
EOF;

$mimeDir = new MimeDir();
$vevent = $mimeDir->parse($iCal);
self::assertEquals('test', $vevent->VEVENT->{0}->getValue());
}
}
Loading