kkga / tdx

CLI todo manager for iCalendar files.
The Unlicense
14 stars 1 forks source link

ical: malformed param value: illegal double-quote #6

Closed WhyNotHugo closed 2 years ago

WhyNotHugo commented 2 years ago

I'm seeing ical: malformed param value: illegal double-quote for this entry:

It seems to have some funky quotes in the X-APPLE-STRUCTURED-LOCATION attribute. I think it's standards-complaint, since other tools / libs don't complain about it.

Here's a sample:

BEGIN:VCALENDAR
CALSCALE:GREGORIAN
PRODID:-//Apple Inc.//iOS 10.2.1//EN
VERSION:2.0
BEGIN:VTIMEZONE
TZID:America/Argentina/Buenos_Aires
BEGIN:DAYLIGHT
DTSTART:20071230T000000
RDATE:20071230T000000
RDATE:20081019T000000
TZNAME:GMT-3
TZOFFSETFROM:-0300
TZOFFSETTO:-0200
END:DAYLIGHT
BEGIN:STANDARD
DTSTART:20080316T000000
RRULE:FREQ=YEARLY;UNTIL=20090315T020000Z;BYDAY=3SU;BYMONTH=3
TZNAME:GMT-3
TZOFFSETFROM:-0200
TZOFFSETTO:-0300
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
CREATED:20170308T193554Z
DTEND;TZID=America/Argentina/Buenos_Aires:20170308T220000
DTSTAMP:20170308T193557Z
DTSTART;TZID=America/Argentina/Buenos_Aires:20170308T190000
LAST-MODIFIED:20170308T193554Z
LOCATION:Home\nSome street 123\nApt "A"\nXXXX 
 CABA\nArgentina\nArgentina
SEQUENCE:0
SUMMARY:Broken entry lala
TRANSP:OPAQUE
UID:2F7602ED-B76E-468D-8A36-CBB45988613E
X-APPLE-STRUCTURED-LOCATION;VALUE=URI;X-ADDRESS=Some street 123\\nApt 
 \"A\"\\nXXXX CABA\\nArgentina\\nArgentina;X-APPLE-ABUID="ab://Home";
 X-APPLE-RADIUS=0;X-APPLE-REFERENCEFRAME=1;X-TITLE=Home:geo:
 -34.123455,-58.123456
END:VEVENT
END:VCALENDAR
kkga commented 2 years ago

Looks like some of the online validators also complain about the unescaped ; and , in X-APPLE-STRUCTURED-LOCATION referring to https://www.rfc-editor.org/rfc/rfc5545.html#section-3.3.11

kkga commented 2 years ago

I guess, in case of malformed ical data, logging the error is the best we can do, since there's no way to partially decode it.

WhyNotHugo commented 2 years ago

Escaping the ; in this case would be wrong. It's be like escaping the ; in this line:

RRULE:FREQ=YEARLY;UNTIL=20090315T020000Z;BYDAY=3SU;BYMONTH=3
WhyNotHugo commented 2 years ago

Oh, it seems the , needs to be escaped, that's the bit that is wrong.