From 6227931881af4e5d2efd7e8164a6dda3408e8ea7 Mon Sep 17 00:00:00 2001 From: Lars Kneschke Date: Mon, 13 Nov 2006 09:19:40 +0000 Subject: [PATCH] Horde::iCalendar vcalendar export bug Special characters in text field are not scaped when events or todos are exported. For example, ',' in the description field are send literal. According to rfc2445 section 4.3.11 there are some characters which must be scaped or quoted. This patch tries to solved this problem. patch contributed by Antoni Matamalas --- phpgwapi/inc/horde/Horde/iCalendar.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/phpgwapi/inc/horde/Horde/iCalendar.php b/phpgwapi/inc/horde/Horde/iCalendar.php index 89a5ead7cf..497a0a365d 100644 --- a/phpgwapi/inc/horde/Horde/iCalendar.php +++ b/phpgwapi/inc/horde/Horde/iCalendar.php @@ -692,6 +692,7 @@ class Horde_iCalendar { } $value = $attribute['value']; + switch ($name) { // Date fields. case 'DTSTAMP': @@ -781,6 +782,17 @@ class Horde_iCalendar { case 'EXRULE': case 'RRULE': + //Text Fields + case 'SUMMARY': + case 'DESCRIPTION': + case 'COMMENT': + $value = str_replace('\\', '\\\\', $value); + $value = str_replace($this->_newline, '\n', $value); + $value = str_replace(',', '\,', $value); + $value = str_replace(';', '\;', $value); + $value = str_replace(':', '\:', $value); + break; + default: break; }