Improve compose_search_name() to not return "email@address <email@address>" entries

which may happen for contacts without name(s)
pull/229/merge
Aleksander Machniak 10 years ago
parent 97ee4c40c1
commit 83f1f6b12f

@ -594,6 +594,13 @@ abstract class rcube_addressbook
switch ($key) { switch ($key) {
case 'name': case 'name':
$value = $name ?: self::compose_list_name($contact); $value = $name ?: self::compose_list_name($contact);
// If name(s) are undefined compose_list_name() may return an email address
// here we prevent from returning the same name and email
if ($name === $email && strpos($result, '{email}') !== false) {
$value = '';
}
break; break;
case 'email': case 'email':

Loading…
Cancel
Save