From 10ec313034386edf12940a00b0e26b8754647568 Mon Sep 17 00:00:00 2001 From: ssodk <59736655+ssodk@users.noreply.github.com> Date: Mon, 13 Jan 2020 11:14:19 +0100 Subject: [PATCH] Update func.inc Remove duplicates in print-view when the recipient list is expanded --- program/steps/mail/func.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index ed75b2d8a..81df46f18 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -1280,6 +1280,7 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null, $j = 0; $out = ''; $allvalues = array(); + $shown_addresses = array(); $show_email = $RCMAIL->config->get('message_show_email'); if ($addicon && !isset($_SESSION['writeable_abook'])) { @@ -1363,6 +1364,7 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null, if (!$moreadrs) { $out .= ($out ? ', ' : '') . $address; + $shown_addresses[] = $address; } if ($max && $j == $max && $c > $j) { @@ -1385,7 +1387,7 @@ function rcmail_address_string($input, $max=null, $linked=false, $addicon=null, 'class' => 'morelink', 'onclick' => '$(this).hide().next().show()', ), $label) - . html::span(array('style' => 'display:none'), join(', ', $allvalues)); + . html::span(array('style' => 'display:none'), join(', ', array_diff($allvalues, $shown_addresses))); } else { $out .= ' ' . html::a(array(