summaryrefslogtreecommitdiff
path: root/program/steps/addressbook/import.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2008-09-25 13:51:24 +0000
committerthomascube <thomas@roundcube.net>2008-09-25 13:51:24 +0000
commitbb8781c6d756c76c65e3cdce4f53bf9cca2f9193 (patch)
tree815e101c3301d6b5841de5878c603945307d9ac3 /program/steps/addressbook/import.inc
parentcefd1d8c913aa81ddce83e9de7f5bfb22aa4b2d9 (diff)
Improve vcard decoding and import step
Diffstat (limited to 'program/steps/addressbook/import.inc')
-rw-r--r--program/steps/addressbook/import.inc11
1 files changed, 6 insertions, 5 deletions
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,