summaryrefslogtreecommitdiff
path: root/roundcubemail/program
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-03-31 06:07:15 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-03-31 06:07:15 +0000
commit43bf81a031570aee2e400f43902352cacea5b6e3 (patch)
treebf158651fd4938e81ff7f6ce304725b5caa95932 /roundcubemail/program
parent8969e936873ed57ac3db90a1a3159b22f92bd78d (diff)
- Add info about indexcontacts.sh script in upgrade procedure
git-svn-id: https://svn.roundcube.net/trunk@4625 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program')
-rw-r--r--roundcubemail/program/steps/mail/autocomplete.inc9
1 files changed, 8 insertions, 1 deletions
diff --git a/roundcubemail/program/steps/mail/autocomplete.inc b/roundcubemail/program/steps/mail/autocomplete.inc
index 36542caec..85f3cf352 100644
--- a/roundcubemail/program/steps/mail/autocomplete.inc
+++ b/roundcubemail/program/steps/mail/autocomplete.inc
@@ -47,8 +47,15 @@ else if ($book_types && $search = get_input_value('_search', RCUBE_INPUT_GPC, tr
if ($result = $abook->search(array('email','name'), $search, false, true, true, 'email')) {
while ($sql_arr = $result->iterate()) {
- foreach ((array)$abook->get_col_values('email', $sql_arr, true) as $email) {
+ // Contact can have more than one e-mail address
+ $email_arr = (array)$abook->get_col_values('email', $sql_arr, true);
+ $email_cnt = count($email_arr);
+ foreach ($email_arr as $email) {
$contact = format_email_recipient($email, $sql_arr['name']);
+ // skip entries that don't match
+ if ($email_cnt > 1 && strpos($contact, $search) === false) {
+ continue;
+ }
// when we've got more than one book, we need to skip duplicates
if ($books_num == 1 || !in_array($contact, $contacts)) {
$contacts[] = $contact;