Fix iCal attendee CN issue

This commit is contained in:
Jörg Lehrke 2010-05-21 16:36:24 +00:00
parent 328f92cedf
commit 7de0936dbb

View File

@ -456,10 +456,13 @@ class calendar_ical extends calendar_boupdate
error_log(__FILE__.'['.__LINE__.'] '.__METHOD__ . error_log(__FILE__.'['.__LINE__.'] '.__METHOD__ .
'()attendee:' . array2string($info) ."\n",3,$this->logfile); '()attendee:' . array2string($info) ."\n",3,$this->logfile);
} }
$participantCN = '"' . (empty($info['cn']) ? $info['name'] : $info['cn']) . '"'; $participantCN = trim(empty($info['cn']) ? $info['name'] : $info['cn']);
$participantCN = str_replace(array('\\', ',', ';', ':'),
array('\\\\', '\\,', '\\;', '\\:'),
$participantCN);
if ($version == '1.0') if ($version == '1.0')
{ {
$participantURL = trim($participantCN . (empty($info['email']) ? '' : ' <' . $info['email'] .'>')); $participantURL = trim('"' . $participantCN . '"' . (empty($info['email']) ? '' : ' <' . $info['email'] .'>'));
} }
else else
{ {
@ -2554,7 +2557,9 @@ class calendar_ical extends calendar_boupdate
// ... and for provided CN // ... and for provided CN
if (!empty($attributes['params']['CN'])) if (!empty($attributes['params']['CN']))
{ {
$cn = $attributes['params']['CN']; $cn = str_replace(array('\\,', '\\;', '\\:', '\\\\'),
array(',', ';', ':', '\\'),
$attributes['params']['CN']);
if ($cn[0] == '"' && substr($cn,-1) == '"') if ($cn[0] == '"' && substr($cn,-1) == '"')
{ {
$cn = substr($cn,1,-1); $cn = substr($cn,1,-1);