From c25a6cf09b9ad1d8aef72f4a37075b30eab2c15e Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sun, 7 Jul 2019 15:18:32 +0200 Subject: [PATCH] Fix bug in miemetype name comparator The code was removing the first matching prefix (x- or x-ms-), which caused 'x-ms-bmp' to end up as 'ms-bmp'. It should be 'bmp'. Fixed by reverting the order of tokens in the regexp. --- program/steps/mail/get.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/program/steps/mail/get.inc b/program/steps/mail/get.inc index 288fb0bdd..526ec0d75 100644 --- a/program/steps/mail/get.inc +++ b/program/steps/mail/get.inc @@ -311,7 +311,7 @@ exit; */ function rcmail_mimetype_compare($type1, $type2) { - $regexp = '~/(x-|x-ms-)~'; + $regexp = '~/(x-ms-|x-)~'; $type1 = preg_replace($regexp, '/', $type1); $type2 = preg_replace($regexp, '/', $type2);