diff --git a/CHANGELOG b/CHANGELOG index 12f612830..419fd32e4 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,8 @@ CHANGELOG Roundcube Webmail =========================== +- Fix bug where contacts search could skip some records (#6130) + RELEASE 1.3.4 ------------- - Fix a couple of warnings on PHP 7.2 (#6098) diff --git a/program/lib/Roundcube/rcube_addressbook.php b/program/lib/Roundcube/rcube_addressbook.php index e670214d5..e7d431b74 100644 --- a/program/lib/Roundcube/rcube_addressbook.php +++ b/program/lib/Roundcube/rcube_addressbook.php @@ -654,13 +654,16 @@ abstract class rcube_addressbook */ public static function compose_contact_key($contact, $sort_col) { - $key = $contact[$sort_col] . ':' . $contact['sourceid']; + $key = $contact[$sort_col]; // add email to a key to not skip contacts with the same name (#1488375) if (($email = self::get_col_values('email', $contact, true)) && !empty($email)) { $key .= ':' . implode(':', (array)$email); } + // Make the key really unique (as we e.g. support contacts with no email) + $key .= ':' . $contact['sourceid'] . ':' . $contact['ID']; + return $key; }