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
This commit is contained in:
Lars Kneschke 2006-11-13 09:19:01 +00:00
parent 630809ee5f
commit 1ba36a6ca5

View File

@ -692,6 +692,7 @@ class Horde_iCalendar {
} }
$value = $attribute['value']; $value = $attribute['value'];
switch ($name) { switch ($name) {
// Date fields. // Date fields.
case 'DTSTAMP': case 'DTSTAMP':
@ -781,6 +782,17 @@ class Horde_iCalendar {
case 'EXRULE': case 'EXRULE':
case 'RRULE': 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: default:
break; break;
} }