summaryrefslogtreecommitdiff
path: root/program/lib/Roundcube
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2015-03-03 16:35:01 +0100
committerThomas Bruederli <bruederli@kolabsys.com>2015-03-03 16:35:01 +0100
commit8e333bcb662b6464f8a6c873cfb8825ac0a11943 (patch)
tree4509c33dd03b4b1a68a4ee1514605630a4c8359a /program/lib/Roundcube
parent3bd027726114a4f66dfcf5cbe069d50b9485f010 (diff)
Only normalize search term when searching in 'words' column
Diffstat (limited to 'program/lib/Roundcube')
-rw-r--r--program/lib/Roundcube/rcube_contacts.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/program/lib/Roundcube/rcube_contacts.php b/program/lib/Roundcube/rcube_contacts.php
index 5cd96b2dd..6438c431a 100644
--- a/program/lib/Roundcube/rcube_contacts.php
+++ b/program/lib/Roundcube/rcube_contacts.php
@@ -355,7 +355,7 @@ class rcube_contacts extends rcube_addressbook
}
else {
// require each word in to be present in one of the fields
- foreach (rcube_utils::normalize_string($value, true) as $word) {
+ foreach (rcube_utils::tokenize_string($value, 1) as $word) {
$groups = array();
foreach ((array)$fields as $idx => $col) {
$groups[] = $this->fulltext_sql_where($word, $mode, $col);
@@ -446,9 +446,10 @@ class rcube_contacts extends rcube_addressbook
{
$WS = ' ';
$AS = $col == 'words' ? $WS : self::SEPARATOR;
+ $words = $col == 'words' ? rcube_utils::normalize_string($value, true) : array($value);
$where = array();
- foreach (rcube_utils::normalize_string($value, true) as $word) {
+ foreach ($words as $word) {
switch ($mode) {
case 1: // strict
$where[] = '(' . $this->db->ilike($col, $word . '%')