summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-03-13 08:56:45 (GMT)
committerThomas Bruederli <bruederli@kolabsys.com>2014-03-13 08:56:45 (GMT)
commit442e9b0c8b2f1545f610d5cdd4a997ffa080d64d (patch)
treedae598be83143a52917ed7b8f96dbbd0aa5b4dd8
parent89e50635a8309b6b466716ad8f3b46cc94f25d84 (diff)
downloadiRony-442e9b0c8b2f1545f610d5cdd4a997ffa080d64d.tar.gz
Set EMAIL type parameters as individual items for better encoding
-rw-r--r--lib/Kolab/CardDAV/ContactsBackend.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Kolab/CardDAV/ContactsBackend.php b/lib/Kolab/CardDAV/ContactsBackend.php
index db73e02..37fd3ea 100644
--- a/lib/Kolab/CardDAV/ContactsBackend.php
+++ b/lib/Kolab/CardDAV/ContactsBackend.php
@@ -698,7 +698,10 @@ class ContactsBackend extends CardDAV\Backend\AbstractBackend
$vc->add('X-CHILDREN', join(',', (array)$contact['children']));
foreach ((array)$contact['email'] as $email) {
- $vc->add('EMAIL', $email['address'], array('type' => rtrim('INTERNET,' . strtoupper($email['type']), ',')));
+ $vemail = VObject\Property::create('EMAIL', $email['address'], array('type' => 'INTERNET'));
+ if (!empty($email['type']))
+ $vemail->offsetSet(null, new VObject\Parameter('type', strtoupper($email['type'])));
+ $vc->add($vemail);
}
foreach ((array)$contact['phone'] as $phone) {