diff --git a/lib/Parser/MimeDir.php b/lib/Parser/MimeDir.php index db0f81531..e9cc75bdc 100644 --- a/lib/Parser/MimeDir.php +++ b/lib/Parser/MimeDir.php @@ -378,6 +378,9 @@ protected function readProperty($line) $property['parameters'][$lastParam] = $value; } elseif (is_array($property['parameters'][$lastParam])) { $property['parameters'][$lastParam][] = $value; + } elseif ($property['parameters'][$lastParam] === $value) { + // When the current value of the parameter is the same as the + // new one, then we can leave the current parameter as it is. } else { $property['parameters'][$lastParam] = [ $property['parameters'][$lastParam], diff --git a/tests/VObject/Parser/MimeDirTest.php b/tests/VObject/Parser/MimeDirTest.php index 183c9ce4c..f46411ab7 100644 --- a/tests/VObject/Parser/MimeDirTest.php +++ b/tests/VObject/Parser/MimeDirTest.php @@ -145,4 +145,26 @@ public function testCaseInsensitiveInlineCharset() $this->assertEquals('Euro', $vcard->FN->getValue()); $this->assertEquals('Test2', $vcard->N->getValue()); } + + public function testParsingTwiceSameContent() + { + $card = <<parse($card); + // we can do a simple assertion here. As long as we don't get an exception, everything is thing + $this->assertEquals('20220612', $vcard->VEVENT->DTSTART->getValue()); + } }