diff options
author | thomascube <thomas@roundcube.net> | 2011-05-13 18:08:37 +0000 |
---|---|---|
committer | thomascube <thomas@roundcube.net> | 2011-05-13 18:08:37 +0000 |
commit | 6b19999841f97e1addfa6ebce79a887aad7467c9 (patch) | |
tree | 1ec019d304979a01af367c097acc596e86bf8306 /program/steps/addressbook | |
parent | 445a4ca04dfcd255f9d89ee76757b04c2d87bbfc (diff) |
Correctly handle empty contact names when importing
Diffstat (limited to 'program/steps/addressbook')
-rw-r--r-- | program/steps/addressbook/import.inc | 6 |
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++; } |