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 09:20:16 (GMT)
commit6ce1738bb94ebf94dd016a76af3bda639d95c279 (patch)
tree6ebb1ab5b3146ccd4e41dadec73bfef5be837959
parenta849c38391d9db7655e4d616c2458748cf3253ae (diff)
downloadiRony-6ce1738bb94ebf94dd016a76af3bda639d95c279.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 b9f0ff8..c9ff807 100644
--- a/lib/Kolab/CardDAV/ContactsBackend.php
+++ b/lib/Kolab/CardDAV/ContactsBackend.php
@@ -684,7 +684,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) {