diff options
author | Aleksander Machniak <alec@alec.pl> | 2022-08-14 11:30:02 +0300 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2022-08-14 11:30:02 +0300 |
commit | 8c487d9b56224a89b0e852c6bc57718b19d1b834 (patch) | |
tree | c0431ce15ee846f91589c2ac9081ea24bef6222b | |
parent | bae45d572842d7f9846638bc2b2f76f327bf7aae (diff) |
Fix duplicate Reply-To header in mail preview
If there's Mail-Reply-To and Reply-To with the same value.
Also cleanup some code.
-rw-r--r-- | program/actions/mail/show.php | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/program/actions/mail/show.php b/program/actions/mail/show.php index 9c81aadf1..33436ba29 100644 --- a/program/actions/mail/show.php +++ b/program/actions/mail/show.php @@ -470,49 +470,33 @@ class rcmail_action_mail_show extends rcmail_action_mail_index $ishtml = false; $header_title = $rcmail->gettext(preg_replace('/(^mail-|-)/', '', $hkey)); + $header_value = null; if ($hkey == 'date') { $header_value = $rcmail->format_date($value, self::$PRINT_MODE ? $rcmail->config->get('date_long', 'x') : null); } else if ($hkey == 'priority') { - if ($value) { - $header_value = html::span('prio' . $value, rcube::Q(self::localized_priority($value))); - $ishtml = true; - } - else { - continue; - } + $header_value = html::span('prio' . $value, rcube::Q(self::localized_priority($value))); + $ishtml = true; } else if ($hkey == 'replyto') { - if ($headers['replyto'] != $headers['from']) { + if ($value != $headers['from']) { $header_value = self::address_string($value, $attr_max, true, $attr_addicon, $charset, $header_title); $ishtml = true; } - else { - continue; - } } else if ($hkey == 'mail-reply-to') { - if ($value - && (!isset($headers['mail-replyto']) || $headers['mail-replyto'] != $headers['replyto']) - && $headers['replyto'] != $headers['from'] - ) { + if ((!isset($headers['replyto']) || $value != $headers['replyto']) && $value != $headers['from']) { $header_value = self::address_string($value, $attr_max, true, $attr_addicon, $charset, $header_title); $ishtml = true; } - else { - continue; - } } else if ($hkey == 'sender') { - if ($value && (!isset($headers['sender']) || $headers['sender'] != $headers['from'])) { + if ($value != $headers['from']) { $header_value = self::address_string($value, $attr_max, true, $attr_addicon, $charset, $header_title); $ishtml = true; } - else { - continue; - } } else if ($hkey == 'mail-followup-to') { $header_value = self::address_string($value, $attr_max, true, $attr_addicon, $charset, $header_title); |