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.
pull/6839/head
Aleksander Machniak 5 years ago
parent bfe2bc17d7
commit c1344643a1

@ -289,7 +289,7 @@ exit;
*/ */
function rcmail_mimetype_compare($type1, $type2) function rcmail_mimetype_compare($type1, $type2)
{ {
$regexp = '~/(x-|x-ms-)~'; $regexp = '~/(x-ms-|x-)~';
$type1 = preg_replace($regexp, '/', $type1); $type1 = preg_replace($regexp, '/', $type1);
$type2 = preg_replace($regexp, '/', $type2); $type2 = preg_replace($regexp, '/', $type2);

Loading…
Cancel
Save