* CalDAV/CardDAV: encoding VT (vertical tab) as it stalls Outlook (CalDav Synchronizer)

This commit is contained in:
Ralf Becker 2019-05-24 15:10:48 +02:00
parent 69d62d91f8
commit 4badda961c
4 changed files with 12 additions and 5 deletions

View File

@ -388,7 +388,7 @@ class addressbook_vcal extends addressbook_bo
{
$options['ENCODING'] = 'FUNAMBOL-QP';
}
elseif (preg_match('/([\000-\012\015\016\020-\037\075])/', $value))
elseif (preg_match(Api\CalDAV\Handler::REQUIRE_QUOTED_PRINTABLE_ENCODING, $value))
{
$options['ENCODING'] = 'QUOTED-PRINTABLE';
}
@ -467,7 +467,7 @@ class addressbook_vcal extends addressbook_bo
{
$options['ENCODING'] = 'FUNAMBOL-QP';
}
elseif (preg_match('/([\000-\012\015\016\020-\037\075])/', $value))
elseif (preg_match(Api\CalDAV\Handler::REQUIRE_QUOTED_PRINTABLE_ENCODING, $value))
{
$options['ENCODING'] = 'QUOTED-PRINTABLE';
}

View File

@ -114,6 +114,13 @@ abstract class Handler
*/
var $new_id;
/**
* Regular expression to identify content requiring QUOTED-PRINTABLE encoding
*
* Used in {addressbook,calendar,infolog}/inc/class.*cal.inc.php
*/
const REQUIRE_QUOTED_PRINTABLE_ENCODING = '/([\000-\012\013\015\016\020-\037\075])/';
/**
* Constructor
*

View File

@ -1034,7 +1034,7 @@ class calendar_ical extends calendar_boupdate
else
{
$paramData['CHARSET'] = '';
if (preg_match('/([\000-\012\015\016\020-\037\075])/', $valueData))
if (preg_match(Api\CalDAV\Handler::REQUIRE_QUOTED_PRINTABLE_ENCODING, $valueData))
{
$paramData['ENCODING'] = 'QUOTED-PRINTABLE';
}

View File

@ -299,7 +299,7 @@ class infolog_ical extends infolog_bo
{
$options['CHARSET'] = '';
if (preg_match('/([\000-\012\015\016\020-\037\075])/', $value))
if (preg_match(Api\CalDAV\Handler::REQUIRE_QUOTED_PRINTABLE_ENCODING, $value))
{
$options['ENCODING'] = 'QUOTED-PRINTABLE';
}
@ -972,7 +972,7 @@ class infolog_ical extends infolog_bo
{
$options['CHARSET'] = '';
if (preg_match('/([\000-\012\015\016\020-\037\075])/', $value))
if (preg_match(Api\CalDAV\Handler::REQUIRE_QUOTED_PRINTABLE_ENCODING, $value))
{
$options['ENCODING'] = 'QUOTED-PRINTABLE';
}