diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-08-22 08:00:47 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-08-22 08:00:47 +0100 |
commit | c27e8fb40821a3401b70b789f1efcb28bab5c50a (patch) | |
tree | 9332f14c5da435840cb73cfe705ba8d13b0b6cb7 | |
parent | 749330a61b23580a87cf223ea40a21f8b28b9225 (diff) | |
download | rspamd-c27e8fb40821a3401b70b789f1efcb28bab5c50a.tar.gz rspamd-c27e8fb40821a3401b70b789f1efcb28bab5c50a.zip |
[Fix] Fix processing of closed tags
-rw-r--r-- | src/libserver/html.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/libserver/html.c b/src/libserver/html.c index 2d57f0b0d..7484f44e8 100644 --- a/src/libserver/html.c +++ b/src/libserver/html.c @@ -1009,7 +1009,7 @@ rspamd_html_process_tag (rspamd_mempool_t *pool, struct html_content *hc, /* Block tag */ nnode = g_node_new (tag); - if (tag->flags & FL_CLOSING) { + if (tag->flags & (FL_CLOSING|FL_CLOSED)) { if (!*cur_level) { msg_debug_html ("bad parent node"); g_node_destroy (nnode); @@ -1426,10 +1426,17 @@ rspamd_html_parse_tag_content (rspamd_mempool_t *pool, if (g_ascii_isspace (*in)) { state = spaces_after_param; } + else if (*in == '/' && *(in + 1) == '>') { + tag->flags |= FL_CLOSED; + } break; case spaces_after_param: if (!g_ascii_isspace (*in)) { + if (*in == '/' && *(in + 1) == '>') { + tag->flags |= FL_CLOSED; + } + state = parse_attr_name; *savep = in; } |