Fix searching by email address in contacts with multiple addresses (#5291)

pull/5298/head
Aleksander Machniak 8 years ago
parent 024800d068
commit 7864a98f08

@ -19,6 +19,7 @@ CHANGELOG Roundcube Webmail
- Fix bug where multi-folder search didn't work for unsubscribed INBOX (#5259)
- Fix bug where "no body" alert could be displayed when sending mailvelope email
- Enigma: Fix keys import from inside of an encrypted message (#5285)
- Fix searching by email address in contacts with multiple addresses (#5291)
RELEASE 1.2.0
-------------

@ -467,9 +467,10 @@ class rcube_contacts extends rcube_addressbook
foreach ($words as $word) {
switch ($mode) {
case 1: // strict
$where[] = '(' . $this->db->ilike($col, $word . '%')
. ' OR ' . $this->db->ilike($col, '%' . $WS . $word . $WS . '%')
. ' OR ' . $this->db->ilike($col, '%' . $WS . $word) . ')';
$where[] = '(' . $this->db->ilike($col, $word)
. ' OR ' . $this->db->ilike($col, $word . $AS . '%')
. ' OR ' . $this->db->ilike($col, '%' . $AS . $word . $AS . '%')
. ' OR ' . $this->db->ilike($col, '%' . $AS . $word) . ')';
break;
case 2: // prefix
$where[] = '(' . $this->db->ilike($col, $word . '%')

Loading…
Cancel
Save