ignore CSS and javascript in html mail
authorPaul Mangan <paul@claws-mail.org>
Fri, 26 Oct 2001 08:42:37 +0000 (08:42 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 26 Oct 2001 08:42:37 +0000 (08:42 +0000)
ChangeLog.claws
configure.in
src/html.c

index 2c878a2ba3b82cabba4dfa87169e7226cd8c06b9..36b7f9ee7f9888c85fab4df3f399da757d221382 100644 (file)
@@ -1,3 +1,10 @@
+2001-10-26 [paul]      0.6.4claws8
+
+       * src/html.c
+               ignore css and javascript tags in html mail
+               case-insensitive, with or without double-quoted
+               strings
+
 2001-10-26 [paul]      0.6.4claws7
 
        * sync with sylpheed 0.6.4cvs1
index 7ce56332d09b4c1be4cd84d8452e309b48fb2a07..7830d01bff2489ec16c748fb3c5cbb755bbb6355 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=6
 MICRO_VERSION=4
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws7
+EXTRA_VERSION=claws8
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index a74f24d808ea3c0763d84d1c0c2a594f775872f8..4507559356eba3b2058e3226bf8d98d065d7929b 100644 (file)
@@ -651,6 +651,8 @@ static void html_get_parenthesis(HTMLParser *parser, gchar *buf, gint len)
                parser->bufp = p + 3;
                return;
        }
+       /* because html is not strict regarding case and double-quoting of
+          tags we have to check for both */
        /* ignore css stuff */
        if (!g_strncasecmp(parser->bufp, "<STYLE type=text/css>", 21)) {
                parser->bufp += 21;
@@ -659,6 +661,30 @@ static void html_get_parenthesis(HTMLParser *parser, gchar *buf, gint len)
                parser->bufp = p + 8;
                return;
        }
+       /* ignore css stuff with double quotes*/
+       if (!g_strncasecmp(parser->bufp, "<STYLE type=\"text/css\">", 23)) {
+               parser->bufp += 23;
+               while ((p = strcasestr(parser->bufp, "</STYLE>")) == NULL)
+                       if (html_read_line(parser) == HTML_EOF) return;
+               parser->bufp = p + 8;
+               return;
+       }
+       /* ignore javascipt stuff */
+       if (!g_strncasecmp(parser->bufp, "<SCRIPT language=javascript>", 28)) {
+               parser->bufp += 28;
+               while ((p = strcasestr(parser->bufp, "</SCRIPT>")) == NULL)
+                       if (html_read_line(parser) == HTML_EOF) return;
+               parser->bufp = p + 8;
+               return;
+       }
+       /* ignore javascipt stuff with double-quotes */
+       if (!g_strncasecmp(parser->bufp, "<SCRIPT language=\"javascript\">", 30)) {
+               parser->bufp += 30;
+               while ((p = strcasestr(parser->bufp, "</SCRIPT>")) == NULL)
+                       if (html_read_line(parser) == HTML_EOF) return;
+               parser->bufp = p + 8;
+               return;
+       }
 
        parser->bufp++;
        while ((p = strchr(parser->bufp, '>')) == NULL)