Skip to content

Commit

Permalink
Fix searching by email address in contacts with multiple addresses (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
alecpl committed May 31, 2016
1 parent 024800d commit 7864a98
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------------
Expand Down
7 changes: 4 additions & 3 deletions program/lib/Roundcube/rcube_contacts.php
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,10 @@ private function fulltext_sql_where($value, $mode, $col = 'words', $bool = 'AND'
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 . '%')
Expand Down

0 comments on commit 7864a98

Please sign in to comment.