aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-mime-part-utils.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2003-03-27 14:05:46 +0800
committerMichael Zucci <zucchi@src.gnome.org>2003-03-27 14:05:46 +0800
commitb3293f0d99b13c1ee49f3605534ee3552cf19158 (patch)
treeaae4093f99f505e75684e56b384755e9e3741c1f /camel/camel-mime-part-utils.c
parentcd51875a54f1e77fb433a9b90277047dc580608f (diff)
downloadgsoc2013-evolution-b3293f0d99b13c1ee49f3605534ee3552cf19158.tar.gz
gsoc2013-evolution-b3293f0d99b13c1ee49f3605534ee3552cf19158.tar.zst
gsoc2013-evolution-b3293f0d99b13c1ee49f3605534ee3552cf19158.zip
Do a more thorough check for html marked as text/plain. Check that the
2003-03-28 Not Zed <NotZed@Ximian.com> * camel-mime-part-utils.c (simple_data_wrapper_construct_from_parser): Do a more thorough check for html marked as text/plain. Check that the text starts with <html or <!doctype. More complete fix for #16817. svn path=/trunk/; revision=20544
Diffstat (limited to 'camel/camel-mime-part-utils.c')
-rw-r--r--camel/camel-mime-part-utils.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/camel/camel-mime-part-utils.c b/camel/camel-mime-part-utils.c
index d71108afa5..2c9c03e104 100644
--- a/camel/camel-mime-part-utils.c
+++ b/camel/camel-mime-part-utils.c
@@ -343,8 +343,9 @@ simple_data_wrapper_construct_from_parser (CamelDataWrapper *dw, CamelMimeParser
while (inptr < inend && isspace ((int) *inptr))
inptr++;
-
- if (inptr < inend && *inptr == '<') {
+
+ if (((inend-inptr) > 5 && g_ascii_strncasecmp(inptr, "<html", 5) == 0)
+ || ((inend-inptr) > 9 && g_ascii_strncasecmp(inptr, "<!doctype", 9) == 0)) {
/* re-tag as text/html */
g_free (ct->subtype);
ct->subtype = g_strdup ("html");