From: Vsevolod Stakhov Date: Fri, 11 Jun 2021 15:33:29 +0000 (+0100) Subject: [Minor] Fix sgml tags processing X-Git-Tag: 3.0~320 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f17e650d2659c78e12edc27caad61c2833d973e;p=thirdparty%2Frspamd.git [Minor] Fix sgml tags processing --- 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);