summaryrefslogtreecommitdiff
path: root/program/steps/mail/func.inc
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2012-12-22 16:39:47 +0100
committerThomas Bruederli <thomas@roundcube.net>2012-12-22 16:39:47 +0100
commit090c49d4a3343d346677ed1687ae28697f5b1c6e (patch)
tree622357972868d377120eb8b609ce8ae8636561d1 /program/steps/mail/func.inc
parent0a9d414084b5c0bef3b319afeddf7e634333a9b1 (diff)
Treat image/pjpeg as image/jpeg
Diffstat (limited to 'program/steps/mail/func.inc')
-rw-r--r--program/steps/mail/func.inc6
1 files changed, 5 insertions, 1 deletions
diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc
index f5165399b..70493766b 100644
--- a/program/steps/mail/func.inc
+++ b/program/steps/mail/func.inc
@@ -1290,7 +1290,7 @@ function rcmail_part_image_type($part)
// Content-Type: image/*...
if (preg_match($mime_regex, $part->mimetype)) {
- return $part->mimetype;
+ return rcmail_fix_mimetype($part->mimetype);
}
// Many clients use application/octet-stream, we'll detect mimetype
@@ -1900,6 +1900,10 @@ function rcmail_fix_mimetype($name)
if (preg_match('/^application\/pdf.+/', $name))
$name = 'application/pdf';
+ // treat image/pjpeg as image/jpeg
+ else if (preg_match('/^image\/p?jpe?g$/', $name))
+ $name = 'image/jpeg';
+
return $name;
}