From 3f17e650d2659c78e12edc27caad61c2833d973e Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 11 Jun 2021 16:33:29 +0100 Subject: [PATCH] [Minor] Fix sgml tags processing --- src/libserver/html/html.cxx | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/libserver/html/html.cxx b/src/libserver/html/html.cxx index 23dabc4d5a..1cbc1f1051 100644 --- a/src/libserver/html/html.cxx +++ b/src/libserver/html/html.cxx @@ -1421,7 +1421,7 @@ html_process_input(rspamd_mempool_t *pool, if (t == '>') { state = tag_end; /* We don't know a lot about sgml tags, ignore them */ - cur_tag = hc->root_tag; + cur_tag = nullptr; continue; } p ++; @@ -1698,11 +1698,14 @@ html_debug_structure(const html_content &hc) -> std::string TEST_CASE("html parsing") { const std::vector> cases{ - {"
", "+html;++div;+++div;"}, - {"
", "+html;++div;+++div;"}, - {"
", "+html;++div;+++div;"}, - {"

", "+p;++p;+++a;"}, - {"
", "+div;++a;"}, + {"", "+html;++body;"}, + {"
", "+html;++div;+++div;"}, + {"
", "+html;++div;+++div;"}, + {"
", "+html;++div;+++div;"}, + {"

", "+p;++p;+++a;"}, + {"
", "+div;++a;"}, + {"", + "+html;++body;+++head;++++body;"} }; rspamd_url_init(NULL); -- 2.47.3