mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:50 +01:00
Fix iCal attendee CN issue
This commit is contained in:
parent
d2c03cd287
commit
e8298f217f
@ -481,10 +481,13 @@ class calendar_ical extends calendar_boupdate
|
||||
error_log(__FILE__.'['.__LINE__.'] '.__METHOD__ .
|
||||
'()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')
|
||||
{
|
||||
$participantURL = trim($participantCN . (empty($info['email']) ? '' : ' <' . $info['email'] .'>'));
|
||||
$participantURL = trim('"' . $participantCN . '"' . (empty($info['email']) ? '' : ' <' . $info['email'] .'>'));
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -495,7 +498,7 @@ class calendar_ical extends calendar_boupdate
|
||||
{
|
||||
$organizerURL = $participantURL;
|
||||
$organizerCN = $participantCN;
|
||||
$organizerUID = $uid;
|
||||
$organizerUID = ($info['type'] != 'e' ? $uid : '');
|
||||
}
|
||||
$attributes['ATTENDEE'][] = $participantURL;
|
||||
// RSVP={TRUE|FALSE} // resonse expected, not set in eGW => status=U
|
||||
@ -570,7 +573,10 @@ class calendar_ical extends calendar_boupdate
|
||||
{
|
||||
$attributes['ORGANIZER'] = $organizerURL;
|
||||
$parameters['ORGANIZER']['CN'] = $organizerCN;
|
||||
$parameters['ORGANIZER']['X-EGROUPWARE-UID'] = $organizerUID;
|
||||
if (!empty($organizerUID))
|
||||
{
|
||||
$parameters['ORGANIZER']['X-EGROUPWARE-UID'] = $organizerUID;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
@ -2695,7 +2701,9 @@ class calendar_ical extends calendar_boupdate
|
||||
// ... and for provided CN
|
||||
if (!empty($attributes['params']['CN']))
|
||||
{
|
||||
$cn = $attributes['params']['CN'];
|
||||
$cn = str_replace(array('\\,', '\\;', '\\:', '\\\\'),
|
||||
array(',', ';', ':', '\\'),
|
||||
$attributes['params']['CN']);
|
||||
if ($cn[0] == '"' && substr($cn,-1) == '"')
|
||||
{
|
||||
$cn = substr($cn,1,-1);
|
||||
|
@ -628,14 +628,14 @@ class Horde_iCalendar {
|
||||
// Parse the remaining attributes.
|
||||
if (preg_match_all('/^((?:[^":]+|(?:"[^"]*")+)*):([^\r\n]*)\r?$/m', $vCal, $matches)) {
|
||||
foreach ($matches[0] as $attribute) {
|
||||
preg_match('/([^;^:]*)((;(?:[^":]+|(?:"[^"]*")+)*)?):([^\r\n]*)[\r\n]*/', $attribute, $parts);
|
||||
preg_match('/([^:;]*)((;(?:(?:[^":\\\]*(?:\\\.)?)+|(?:"[^"]*")+)*)?):([^\r\n]*)[\r\n]*/', $attribute, $parts);
|
||||
$tag = trim(String::upper($parts[1]));
|
||||
$value = $parts[4];
|
||||
$params = array();
|
||||
|
||||
// Parse parameters.
|
||||
if (!empty($parts[2])) {
|
||||
preg_match_all('/;(([^;=]*)(=([^;]*))?)/', $parts[2], $param_parts);
|
||||
preg_match_all('/;(([^;=]*)(=((?:[^;\\\]*(?:\\\.)?)*))?)/', $parts[2], $param_parts);
|
||||
foreach ($param_parts[2] as $key => $paramName) {
|
||||
$paramName = String::upper($paramName);
|
||||
$paramValue = $param_parts[4][$key];
|
||||
|
Loading…
Reference in New Issue
Block a user