From 44fe6003ffdf6ab50feca5dd755d10e17b12846d Mon Sep 17 00:00:00 2001 From: Patrick Maia Date: Thu, 7 Aug 2014 14:37:03 -0300 Subject: fixes bug in which plain text emails were not being properly formatted --- web-ui/app/js/helpers/view_helper.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'web-ui/app/js/helpers/view_helper.js') diff --git a/web-ui/app/js/helpers/view_helper.js b/web-ui/app/js/helpers/view_helper.js index 02067005..76e574bf 100644 --- a/web-ui/app/js/helpers/view_helper.js +++ b/web-ui/app/js/helpers/view_helper.js @@ -21,7 +21,7 @@ define( } function isQuotedPrintableBodyPart (bodyPart) { - return bodyPart.headers && + return bodyPart.headers && bodyPart.headers['Content-Transfer-Encoding'] && bodyPart.headers['Content-Transfer-Encoding'] === 'quoted-printable'; } @@ -37,8 +37,10 @@ define( if (isQuotedPrintableBodyPart(bodyPart)) { body = quotedPrintable.decode(bodyPart.body); - } else { + } else if (bodyPart.body) { body = bodyPart.body; + } else { + body = bodyPart; } return htmlWhitelister.sanitize(body, htmlWhitelister.tagPolicy); -- cgit v1.2.3