no extra charset attributes in iCal for GroupDAV/CalDAV

This commit is contained in:
Ralf Becker 2008-06-07 17:54:40 +00:00
parent f11875aad9
commit 25b1924665
2 changed files with 5 additions and 4 deletions

View File

@ -105,7 +105,7 @@ class calendar_groupdav extends groupdav_handler
);
if ($calendar_data)
{
$content = ExecMethod2('calendar.boical.exportVCal',array($event),'2.0','PUBLISH',false);
$content = ExecMethod2('calendar.boical.exportVCal',array($event),'2.0','PUBLISH',false,false);
$props[] = HTTP_WebDAV_Server::mkprop('getcontentlength',bytes($content));
$props[] = HTTP_WebDAV_Server::mkprop(groupdav::CALDAV,'calendar-data',$content);
}
@ -246,7 +246,7 @@ class calendar_groupdav extends groupdav_handler
{
return $event;
}
$options['data'] = ExecMethod2('calendar.boical.exportVCal',array($event),'2.0','PUBLISH',false);
$options['data'] = ExecMethod2('calendar.boical.exportVCal',array($event),'2.0','PUBLISH',false,false);
$options['mimetype'] = 'text/calendar; charset=utf-8';
header('Content-Encoding: identity');
header('ETag: '.$this->get_etag($event));

View File

@ -109,9 +109,10 @@ class calendar_ical extends calendar_boupdate
* @param string $method='PUBLISH'
* @param boolean $force_own_uid=true ignore the stored and maybe from the client transfered uid and generate a new one
* RalfBecker: GroupDAV/CalDAV requires to switch that non RFC conform behavior off, dont know if SyncML still needs it
* @param boolean $extra_charset_attribute=true GroupDAV/CalDAV dont need the charset attribute and some clients have problems with it
* @return string/boolean string with vCal or false on error (eg. no permission to read the event)
*/
function &exportVCal($events,$version='1.0', $method='PUBLISH',$force_own_uid=true)
function &exportVCal($events,$version='1.0', $method='PUBLISH',$force_own_uid=true,$extra_charset_attribute=true)
{
$egwSupportedFields = array(
'CLASS' => array('dbName' => 'public'),
@ -442,7 +443,7 @@ class calendar_ical extends calendar_boupdate
{
$options['ENCODING'] = 'QUOTED-PRINTABLE';
}
if(preg_match('/([\177-\377])/',$valueData))
if($extra_charset_attribute && preg_match('/([\177-\377])/',$valueData))
{
$options['CHARSET'] = 'UTF-8';
}