summaryrefslogtreecommitdiff
path: root/program/steps/mail/autocomplete.inc
diff options
context:
space:
mode:
Diffstat (limited to 'program/steps/mail/autocomplete.inc')
-rw-r--r--program/steps/mail/autocomplete.inc14
1 files changed, 7 insertions, 7 deletions
diff --git a/program/steps/mail/autocomplete.inc b/program/steps/mail/autocomplete.inc
index f9e8d71a4..acc86229f 100644
--- a/program/steps/mail/autocomplete.inc
+++ b/program/steps/mail/autocomplete.inc
@@ -21,16 +21,16 @@
*/
if ($RCMAIL->action == 'group-expand') {
- $abook = $RCMAIL->get_address_book(get_input_value('_source', RCUBE_INPUT_GPC));
- if ($gid = get_input_value('_gid', RCUBE_INPUT_GPC)) {
+ $abook = $RCMAIL->get_address_book(rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC));
+ if ($gid = rcube_utils::get_input_value('_gid', rcube_utils::INPUT_GPC)) {
$members = array();
$abook->set_group($gid);
$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
}
}
@@ -45,9 +45,9 @@ if ($RCMAIL->action == 'group-expand') {
$MAXNUM = (int) $RCMAIL->config->get('autocomplete_max', 15);
$mode = (int) $RCMAIL->config->get('addressbook_search_mode');
$single = (bool) $RCMAIL->config->get('autocomplete_single');
-$search = get_input_value('_search', RCUBE_INPUT_GPC, true);
-$source = get_input_value('_source', RCUBE_INPUT_GPC);
-$sid = get_input_value('_id', RCUBE_INPUT_GPC);
+$search = rcube_utils::get_input_value('_search', rcube_utils::INPUT_GPC, true);
+$source = rcube_utils::get_input_value('_source', rcube_utils::INPUT_GPC);
+$sid = rcube_utils::get_input_value('_id', rcube_utils::INPUT_GPC);
if (strlen($source))
$book_types = array($source);