summaryrefslogtreecommitdiff
path: root/program/steps
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps')
-rw-r--r--program/steps/addressbook/import.inc8
1 files changed, 4 insertions, 4 deletions
diff --git a/program/steps/addressbook/import.inc b/program/steps/addressbook/import.inc
index 7b52bdcee..018c980eb 100644
--- a/program/steps/addressbook/import.inc
+++ b/program/steps/addressbook/import.inc
@@ -164,10 +164,11 @@ if ($_FILES['_file']['tmp_name'] && is_uploaded_file($_FILES['_file']['tmp_name'
$CONTACTS->delete_all();
foreach ($vcards as $vcard) {
- $email = $vcard->email[0];
+ $email = $vcard->email[0];
+ $a_record = $vcard->get_assoc();
- // skip entries without an e-mail address
- if (empty($email)) {
+ // skip entries without an e-mail address or invalid
+ if (empty($email) || !$CONTACTS->validate($a_record, true)) {
$IMPORT_STATS->nomail++;
continue;
}
@@ -188,7 +189,6 @@ if ($_FILES['_file']['tmp_name'] && is_uploaded_file($_FILES['_file']['tmp_name'
}
}
- $a_record = $vcard->get_assoc();
$a_record['vcard'] = $vcard->export();
$plugin = $RCMAIL->plugins->exec_hook('contact_create', array('record' => $a_record, 'source' => null));