From 6b87f8e023011e1f10c899d1d1d27f8309ceda52 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 10 Sep 2013 15:34:02 +0200 Subject: Fix for case when email array is not flat --- program/steps/addressbook/save.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'program') 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) -- cgit v1.2.3