summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--program/steps/addressbook/save.inc4
1 files changed, 3 insertions, 1 deletions
diff --git a/program/steps/addressbook/save.inc b/program/steps/addressbook/save.inc
index e7e5efc63..bd6c14bca 100644
--- a/program/steps/addressbook/save.inc
+++ b/program/steps/addressbook/save.inc
@@ -75,8 +75,10 @@ foreach ($GLOBALS['CONTACT_COLTYPES'] as $col => $colprop) {
if (empty($a_record['name'])) {
$a_record['name'] = rcube_addressbook::compose_display_name($a_record, true);
// Reset it if equals to email address (from compose_display_name())
- if ($a_record['name'] == $a_record['email'][0])
+ $email = rcube_addressbook::get_col_values('email', $a_record, true);
+ if ($a_record['name'] == $email[0]) {
$a_record['name'] = '';
+ }
}
// do input checks (delegated to $CONTACTS instance)