summaryrefslogtreecommitdiff
path: root/program/steps/addressbook/import.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2011-05-13 18:08:37 +0000
committerthomascube <thomas@roundcube.net>2011-05-13 18:08:37 +0000
commit6b19999841f97e1addfa6ebce79a887aad7467c9 (patch)
tree1ec019d304979a01af367c097acc596e86bf8306 /program/steps/addressbook/import.inc
parent445a4ca04dfcd255f9d89ee76757b04c2d87bbfc (diff)
Correctly handle empty contact names when importing
Diffstat (limited to 'program/steps/addressbook/import.inc')
-rw-r--r--program/steps/addressbook/import.inc6
1 files changed, 3 insertions, 3 deletions
diff --git a/program/steps/addressbook/import.inc b/program/steps/addressbook/import.inc
index e20fbe082..4583be508 100644
--- a/program/steps/addressbook/import.inc
+++ b/program/steps/addressbook/import.inc
@@ -156,12 +156,12 @@ if ($_FILES['_file']['tmp_name'] && is_uploaded_file($_FILES['_file']['tmp_name'
if (!$replace && $email) {
// compare e-mail address
$existing = $CONTACTS->search('email', $email, false, false);
- if (!$existing->count) { // compare display name
+ if (!$existing->count && $vcard->displayname) { // compare display name
$existing = $CONTACTS->search('name', $vcard->displayname, false, false);
}
if ($existing->count) {
$IMPORT_STATS->skipped++;
- $IMPORT_STATS->skipped_names[] = $vcard->displayname;
+ $IMPORT_STATS->skipped_names[] = $vcard->displayname ? $vcard->displayname : $email;
continue;
}
}
@@ -180,7 +180,7 @@ if ($_FILES['_file']['tmp_name'] && is_uploaded_file($_FILES['_file']['tmp_name'
if ($success) {
$IMPORT_STATS->inserted++;
- $IMPORT_STATS->names[] = $vcard->displayname;
+ $IMPORT_STATS->names[] = $vcard->displayname ? $vcard->displayname : $email;
} else {
$IMPORT_STATS->errors++;
}