From afd5e4f8a93f9267535a45dcabe047c02fac9a5b Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Thu, 19 Feb 2015 07:44:13 -0500
Subject: [PATCH] Fix needless security warning on BMP attachments display (#1490282)
---
program/steps/mail/func.inc | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index 48d9899..c45fd2f 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -1959,9 +1959,16 @@
// 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)
--
Gitblit v1.9.1