From 21ad2c88b1b38366f7e27e964603cafb5360d456 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 8 Nov 2016 12:54:07 +0300 Subject: [PATCH] [Fix] Fix parsing of unquoted HTML attributes Issue: #1092 Reported by: @moisseev --- src/libserver/html.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libserver/html.c b/src/libserver/html.c index d36b8d6db..94ac6915f 100644 --- a/src/libserver/html.c +++ b/src/libserver/html.c @@ -1178,13 +1178,15 @@ rspamd_html_parse_tag_content (rspamd_mempool_t *pool, break; case parse_value: - if (g_ascii_isspace (*in) || *in == '>' || *in == '/') { - if (*in == '/') { - tag->flags |= FL_CLOSED; - } + if (*in == '/' && *(in + 1) == '>') { + tag->flags |= FL_CLOSED; + store = TRUE; + } + else if (g_ascii_isspace (*in) || *in == '>') { store = TRUE; state = spaces_after_param; } + if (store) { if (*savep != NULL) { g_assert (tag->params != NULL); -- 2.39.5