aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--libsylph/html.c14
2 files changed, 16 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index c5fa62e2..d4d36e65 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2011-08-10
+ * libsylph/html.c: html_get_parenthesis(): fixed a bug that </style>
+ end tags were not properly searched if whitespace was inserted in it
+ (ex. </style > </style[\n]>).
+
+2011-08-10
+
* libsylph/procmime.c: removed alloca() calls.
2011-08-03
diff --git a/libsylph/html.c b/libsylph/html.c
index e61ea7cf..7799549a 100644
--- a/libsylph/html.c
+++ b/libsylph/html.c
@@ -621,16 +621,22 @@ static void html_get_parenthesis(HTMLParser *parser, gchar *buf, gint len)
}
if (!g_ascii_strncasecmp(parser->bufp, "<style", 6)) {
parser->bufp += 6;
- while ((p = strcasestr(parser->bufp, "</style>")) == NULL)
+ while ((p = strcasestr(parser->bufp, "</style")) == NULL)
if (html_read_line(parser) == HTML_EOF) return;
- parser->bufp = p + 8;
+ parser->bufp = p + 7;
+ while ((p = strchr(parser->bufp, '>')) == NULL)
+ if (html_read_line(parser) == HTML_EOF) return;
+ parser->bufp = p + 1;
return;
}
if (!g_ascii_strncasecmp(parser->bufp, "<script", 7)) {
parser->bufp += 7;
- while ((p = strcasestr(parser->bufp, "</script>")) == NULL)
+ while ((p = strcasestr(parser->bufp, "</script")) == NULL)
+ if (html_read_line(parser) == HTML_EOF) return;
+ parser->bufp = p + 8;
+ while ((p = strchr(parser->bufp, '>')) == NULL)
if (html_read_line(parser) == HTML_EOF) return;
- parser->bufp = p + 9;
+ parser->bufp = p + 1;
return;
}