Bug 1525120 - Fix condition for decoding attachments (base64/qp) when saving or forwarding. r+a=jorgk
authorAlfred Peters <infofrommozilla@gmail.com>
Sun, 17 Feb 2019 09:18:00 +0100
changeset 34356 e243207d0509362dc760c28ebfc3204a6732f832
parent 34355 f9037fd1be3d1435bf7bf0fd45ce3045268febab
child 34357 43225f621c4ca63904f299ccf589e0bc5a88eebd
push id389
push userclokep@gmail.com
push dateMon, 18 Mar 2019 19:01:53 +0000
bugs1525120
Bug 1525120 - Fix condition for decoding attachments (base64/qp) when saving or forwarding. r+a=jorgk
mailnews/mime/src/mimeleaf.cpp
--- a/mailnews/mime/src/mimeleaf.cpp
+++ b/mailnews/mime/src/mimeleaf.cpp
@@ -92,20 +92,19 @@ MimeLeaf_parse_begin (MimeObject *obj)
 
   /* Initialize a decoder if necessary.
    */
   if (!obj->encoding ||
       // If we need the object as "raw" for saving or forwarding,
       // don't decode text parts of message types. Other output formats,
       // like "display" (nsMimeMessageBodyDisplay), need decoding.
       (obj->options->format_out == nsMimeOutput::nsMimeMessageRaw &&
-       obj->parent &&
+       obj->parent && obj->parent->output_p &&
        (!PL_strcasecmp(obj->parent->content_type, MESSAGE_NEWS) ||
-        !PL_strcasecmp(obj->parent->content_type, MESSAGE_RFC822)) &&
-       !PL_strncasecmp(obj->content_type, "text/", 5)))
+        !PL_strcasecmp(obj->parent->content_type, MESSAGE_RFC822))))
     /* no-op */ ;
   else if (!PL_strcasecmp(obj->encoding, ENCODING_BASE64))
   fn = &MimeB64DecoderInit;
   else if (!PL_strcasecmp(obj->encoding, ENCODING_QUOTED_PRINTABLE))
   leaf->decoder_data =
           MimeQPDecoderInit(((MimeConverterOutputCallback)
                         ((MimeLeafClass *)obj->clazz)->parse_decoded_buffer),
                         obj, obj);