Skip to content

Commit

Permalink
Fix bug where contacts search could skip some records (#6130)
Browse files Browse the repository at this point in the history
Conflicts:
	CHANGELOG
  • Loading branch information
alecpl committed Jan 10, 2018
1 parent 917ae1c commit 2eeb2c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
5 changes: 4 additions & 1 deletion program/lib/Roundcube/rcube_addressbook.php
Original file line number Diff line number Diff line change
Expand Up @@ -654,13 +654,16 @@ public static function compose_search_name($contact, $email = null, $name = null
*/
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;
}

Expand Down

0 comments on commit 2eeb2c7

Please sign in to comment.