Skip to content

Ignore un-escaped commas when parsing single-value properties#128

Open
pinchartl wants to merge 1 commit into
py-vobject:masterfrom
pinchartl:comma
Open

Ignore un-escaped commas when parsing single-value properties#128
pinchartl wants to merge 1 commit into
py-vobject:masterfrom
pinchartl:comma

Conversation

@pinchartl

Copy link
Copy Markdown

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

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: py-vobject#55
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support ignoring un-escaped commas when parsing property values?

1 participant