From 83f1f6b12fb5405ca598322e09b3ccd0842ccc85 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 25 Feb 2015 09:22:54 -0500 Subject: Improve compose_search_name() to not return "email@address " entries which may happen for contacts without name(s) --- program/lib/Roundcube/rcube_addressbook.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'program/lib/Roundcube') diff --git a/program/lib/Roundcube/rcube_addressbook.php b/program/lib/Roundcube/rcube_addressbook.php index 69f8bf934..31189e0fc 100644 --- a/program/lib/Roundcube/rcube_addressbook.php +++ b/program/lib/Roundcube/rcube_addressbook.php @@ -594,6 +594,13 @@ abstract class rcube_addressbook switch ($key) { case 'name': $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; case 'email': -- cgit v1.2.3