diff options
Diffstat (limited to 'program/steps/mail/get.inc')
-rw-r--r-- | program/steps/mail/get.inc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/program/steps/mail/get.inc b/program/steps/mail/get.inc index a27e788a3..e0c4e2911 100644 --- a/program/steps/mail/get.inc +++ b/program/steps/mail/get.inc @@ -134,7 +134,7 @@ else if (strlen($part_id)) { $valid = $file_extension && in_array($file_extension, (array)$extensions) || !empty($_REQUEST['_mimeclass']); // 2. detect the real mimetype of the attachment part and compare it with the stated mimetype and filename extension - if ($valid || !$file_extension || $mimetype == 'application/octet-stream' || $mimetype == 'text/plain') { + if ($valid || !$file_extension || $mimetype == 'application/octet-stream' || stripos($mimetype, 'text/') === 0) { if ($part->body) // part body is already loaded $body = $part->body; else if ($part->size && $part->size < 1024*1024) // load the entire part if it's small enough @@ -189,8 +189,8 @@ else if (strlen($part_id)) { rcube_label(array( 'name' => 'attachmentvalidationerror', 'vars' => array( - 'expected' => $mimetype . ($file_extension ? "(.$file_extension)" : ''), - 'detected' => $real_mimetype . ($extensions[0] ? "(.$extensions[0])" : ''), + 'expected' => $mimetype . ($file_extension ? " (.$file_extension)" : ''), + 'detected' => $real_mimetype . ($extensions[0] ? " (.$extensions[0])" : ''), ) )) . html::p(array('class' => 'rcmail-inline-buttons'), @@ -233,7 +233,6 @@ else if (strlen($part_id)) { header("Content-Transfer-Encoding: binary"); } - // deliver part content if ($ctype_primary == 'text' && $ctype_secondary == 'html' && empty($plugin['download'])) { // Check if we have enough memory to handle the message in it @@ -358,7 +357,8 @@ else if (strlen($part_id)) { header("Content-Length: $size"); } - $sent = $RCMAIL->storage->get_message_part($MESSAGE->uid, $part->mime_id, $part, true); + // 8th argument disables re-formatting of text/* parts (#1489267) + $sent = $RCMAIL->storage->get_message_part($MESSAGE->uid, $part->mime_id, $part, true, null, false, 0, false); } } |