diff --git a/plugins/libcalendaring/libvcalendar.php b/plugins/libcalendaring/libvcalendar.php index 3d9be7af..52aa7122 100644 --- a/plugins/libcalendaring/libvcalendar.php +++ b/plugins/libcalendaring/libvcalendar.php @@ -443,14 +443,8 @@ class libvcalendar implements Iterator case 'LOCATION': case 'DESCRIPTION': - if ($this->is_apple()) { - $event[strtolower($prop->name)] = str_replace('\,', ',', $prop->value); - break; - } - // else: fall through - case 'URL': - $event[strtolower($prop->name)] = $prop->value; + $event[strtolower($prop->name)] = str_replace('\,', ',', $prop->value); break; case 'CATEGORY': diff --git a/plugins/libcalendaring/tests/libvcalendar.php b/plugins/libcalendaring/tests/libvcalendar.php index 8526c5b4..a74eaf39 100644 --- a/plugins/libcalendaring/tests/libvcalendar.php +++ b/plugins/libcalendaring/tests/libvcalendar.php @@ -207,6 +207,19 @@ class libvcalendar_test extends PHPUnit_Framework_TestCase $this->assertEquals('-M', $alarm[1], "Alarm unit"); } + /** + * + */ + function test_escaped_values() + { + $ical = new libvcalendar(); + $events = $ical->import_from_file(__DIR__ . '/resources/escaped.ics', 'UTF-8'); + $event = $events[0]; + + $this->assertEquals("House, Street, Zip Place", $event['location'], "Decode escaped commas in location value"); + $this->assertEquals("Me, meets Them\nThem, meet Me", $event['description'], "Decode description value"); + } + /** * @depends test_import */ diff --git a/plugins/libcalendaring/tests/resources/escaped.ics b/plugins/libcalendaring/tests/resources/escaped.ics new file mode 100644 index 00000000..eb39a073 --- /dev/null +++ b/plugins/libcalendaring/tests/resources/escaped.ics @@ -0,0 +1,25 @@ +BEGIN:VCALENDAR +PRODID:-//K Desktop Environment//NONSGML KOrganizer 4.11.3.0//EN +VERSION:2.0 +X-KDE-ICAL-IMPLEMENTATION-VERSION:1.0 +METHOD:REQUEST +BEGIN:VEVENT +UID:4113ab9d-ffbb-aa00-c372-deb93de6b539 +ORGANIZER;CN="Organizor":MAILTO:organizor@example.org +DTSTAMP:20140225T160532Z +ATTENDEE;CN="Master of Desaster";RSVP=TRUE;PARTSTAT=NEEDS-ACTION; + ROLE=REQ-PARTICIPANT;X-UID=100156408:mailto:master@desaster.com +ATTENDEE;CN="John Doe";RSVP=TRUE;PARTSTAT=NEEDS-ACTION; + ROLE=REQ-PARTICIPANT;X-UID=115484392:mailto:doe@example.com +ATTENDEE;CN="Thomas Kolab";RSVP=TRUE;PARTSTAT=NEEDS-ACTION; + ROLE=REQ-PARTICIPANT;X-UID=115936264:mailto:thomas@kolab.org +CREATED:20140225T160335Z +LAST-MODIFIED:20140225T160335Z +DESCRIPTION:Me\, meets Them\nThem\, meet Me +SUMMARY:Meeting w/Them +LOCATION:House\, Street\, Zip Place +DTSTART:20140305T150000Z +DTEND:20140305T170000Z +TRANSP:OPAQUE +END:VEVENT +END:VCALENDAR