From 6cd85165a1d4f52c359d9df180fd349e48193747 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 8 Jun 2026 15:45:24 +0300 Subject: [PATCH] Ignore un-escaped commas when parsing single-value properties Some non-conformant implementations of RFC 5545 (namely PRODID:-//Microsoft Corporation//Outlook MIMEDIR//EN) fail to escape COMMA characters in text property values. For instance, DESCRIPTION:Hi Laurent,\nYou have been requested to meet with [...] The COMMA character is used to delimitate values in multi-value properties, and must be escaped according to the RFC when a literal comma is needed. When parsing the above DESCRIPTION property, vobject returns "Hi Laurent" as the property value. Ignoring un-escaped comas in properties defined as accepting a single value should be safe. Fortunately, vobject marks those properties by associating them with TextBehaviour. We can simply change the behaviour to not use the comma as a list separator. Closes: #55 Signed-off-by: Laurent Pinchart --- vobject/icalendar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vobject/icalendar.py b/vobject/icalendar.py index 6ce5502..7c464ce 100644 --- a/vobject/icalendar.py +++ b/vobject/icalendar.py @@ -693,7 +693,7 @@ def decode(cls, line): if encoding and encoding.upper() == cls.base64string: line.value = base64.b64decode(line.value) else: - line.value = stringToTextValues(line.value)[0] + line.value = stringToTextValues(line.value, listSeparator=None)[0] line.encoded = False @classmethod