From bb8781c6d756c76c65e3cdce4f53bf9cca2f9193 Mon Sep 17 00:00:00 2001 From: thomascube Date: Thu, 25 Sep 2008 13:51:24 +0000 Subject: Improve vcard decoding and import step --- program/steps/addressbook/import.inc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'program/steps/addressbook/import.inc') diff --git a/program/steps/addressbook/import.inc b/program/steps/addressbook/import.inc index a0786e214..93452eccd 100644 --- a/program/steps/addressbook/import.inc +++ b/program/steps/addressbook/import.inc @@ -124,6 +124,12 @@ if ($_FILES['_file']['tmp_name'] && is_uploaded_file($_FILES['_file']['tmp_name' foreach ($vcards as $vcard) { $email = $vcard->email[0]; + // skip entries without an e-mail address + if (empty($email)) { + $IMPORT_STATS->nomail++; + continue; + } + if (!$replace) { // compare e-mail address $existing = $CONTACTS->search('email', $email, false, false); @@ -135,11 +141,6 @@ if ($_FILES['_file']['tmp_name'] && is_uploaded_file($_FILES['_file']['tmp_name' continue; } } - // skip entries without an e-mail address - if (empty($email)) { - $IMPORT_STATS->nomail++; - continue; - } $success = $CONTACTS->insert(array( 'name' => $vcard->displayname, -- cgit v1.2.3