summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2009-05-14 13:18:36 +0000
committeralecpl <alec@alec.pl>2009-05-14 13:18:36 +0000
commitcea956cf6a28aa1a4fede59a9309ec626c4ebc2e (patch)
tree51af5ddce16668d4cf6aa13cfb9966ea27fbf695 /program
parent2d1a451c25c65e6bae159d2a127b5f4e66d01c46 (diff)
- Fix autocomplete problem with capital letters (#1485792)
Diffstat (limited to 'program')
-rw-r--r--program/js/app.js7
-rw-r--r--program/steps/mail/autocomplete.inc2
2 files changed, 5 insertions, 4 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 2fb6ce53e..da480aa67 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -2564,11 +2564,14 @@ function rcube_webmail()
q = q.replace(/(^\s+|\s+$)/g, '').toLowerCase();
// Don't (re-)search if string is empty or if the last results are still active
- if (!q.length || q == this.ksearch_value)
+ if (q == this.ksearch_value)
return;
-
+
this.ksearch_value = q;
+ if (!q.length)
+ return;
+
this.display_message(this.get_label('searching'), 'loading', true);
this.http_post('autocomplete', '_search='+urlencode(q));
};
diff --git a/program/steps/mail/autocomplete.inc b/program/steps/mail/autocomplete.inc
index b1aba7d62..5b89ff0f3 100644
--- a/program/steps/mail/autocomplete.inc
+++ b/program/steps/mail/autocomplete.inc
@@ -31,11 +31,9 @@ if ($book_types && $search = get_input_value('_search', RCUBE_INPUT_POST)) {
if ($result = $abook->search(array('email','name'), $search)) {
while ($sql_arr = $result->iterate()) {
- if (stripos((string)$sql_arr['email'], $search) !== false || stripos((string)$sql_arr['name'], $search) !== false) {
$contacts[] = format_email_recipient($sql_arr['email'], $sql_arr['name']);
if (count($contacts) >= $MAXNUM)
break 2;
- }
}
}
}