From b3d463631ac0c7489cbce63e07e5dd724f7dca04 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Mon, 24 Sep 2012 16:05:52 +0000 Subject: [PATCH] Strip out item groups from Apple Addressbook before processing --- addressbook/inc/class.addressbook_import_vcard.inc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addressbook/inc/class.addressbook_import_vcard.inc.php b/addressbook/inc/class.addressbook_import_vcard.inc.php index c5b5b05302..38fb8af6bb 100644 --- a/addressbook/inc/class.addressbook_import_vcard.inc.php +++ b/addressbook/inc/class.addressbook_import_vcard.inc.php @@ -117,7 +117,10 @@ class addressbook_import_vcard implements importexport_iface_import_plugin { // Failures $this->errors = array(); - $contacts = new egw_ical_iterator($_stream, '', $charset, array($this, '_vcard'),array( + // Fix for Apple Addressbook + $vCard = preg_replace('/item\d\.(ADR|TEL|EMAIL|URL)/', '\1', stream_get_contents($_stream)); + + $contacts = new egw_ical_iterator($vCard, '', $charset, array($this, '_vcard'),array( // Owner (addressbook) $contact_owner ));