From 4a2a62de30eae35398dc1e6fcca99c469dd218e6 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 19 Feb 2015 13:43:43 +0100 Subject: Fix needless security warning on BMP attachments display (#1490282) --- program/steps/mail/func.inc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'program/steps/mail/func.inc') diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 48d989954..c45fd2f97 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -1959,9 +1959,16 @@ function rcmail_identity_select($MESSAGE, $identities = null, $compose_mode = 'r // Fixes some content-type names function rcmail_fix_mimetype($name) { + $map = array( + 'image/x-ms-bmp' => 'image/bmp', // #1490282 + ); + + if ($alias = $map[strtolower($name)]) { + $name = $alias; + } // Some versions of Outlook create garbage Content-Type: // application/pdf.A520491B_3BF7_494D_8855_7FAC2C6C0608 - if (preg_match('/^application\/pdf.+/', $name)) { + else if (preg_match('/^application\/pdf.+/', $name)) { $name = 'application/pdf'; } // treat image/pjpeg (image/pjpg, image/jpg) as image/jpeg (#1489097) -- cgit v1.2.3