summaryrefslogtreecommitdiff
path: root/program/steps/mail/autocomplete.inc
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-12-17 11:05:53 +0100
committerAleksander Machniak <alec@alec.pl>2013-12-17 11:05:53 +0100
commit774f9dc8350b2a4e41213e16e0a30560e2d41ff1 (patch)
treee5376c15b47f086b1a072b4731f4f482dfaad5a0 /program/steps/mail/autocomplete.inc
parenta520f331c16fc703cc92d5b9853fb91805f82305 (diff)
Fix replacing group name with group members on autocompletion
(for some addressbook plugins where email field is not a flat array)
Diffstat (limited to 'program/steps/mail/autocomplete.inc')
-rw-r--r--program/steps/mail/autocomplete.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/program/steps/mail/autocomplete.inc b/program/steps/mail/autocomplete.inc
index f9e8d71a4..baf45f287 100644
--- a/program/steps/mail/autocomplete.inc
+++ b/program/steps/mail/autocomplete.inc
@@ -28,9 +28,9 @@ if ($RCMAIL->action == 'group-expand') {
$abook->set_pagesize(1000); // TODO: limit number of group members by config
$result = $abook->list_records($RCMAIL->config->get('contactlist_fields'));
while ($result && ($sql_arr = $result->iterate())) {
- foreach ((array)$sql_arr['email'] as $email) {
+ $emails = (array) $abook->get_col_values('email', $sql_arr, true);
+ if (!empty($emails) && ($email = array_shift($emails))) {
$members[] = format_email_recipient($email, rcube_addressbook::compose_list_name($sql_arr));
- break; // only expand one email per contact
}
}