From e9f48d91f1a668810c5511c9b6361c1ed5ada443 Mon Sep 17 00:00:00 2001 From: thomasb Date: Thu, 25 Sep 2008 13:51:24 +0000 Subject: Improve vcard decoding and import step git-svn-id: https://svn.roundcube.net/trunk@1891 208e9e7b-5314-0410-a742-e7e81cd9613c --- roundcubemail/program/steps/addressbook/import.inc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'roundcubemail/program/steps') diff --git a/roundcubemail/program/steps/addressbook/import.inc b/roundcubemail/program/steps/addressbook/import.inc index a0786e214..93452eccd 100644 --- a/roundcubemail/program/steps/addressbook/import.inc +++ b/roundcubemail/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