]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Html: Attach inline tags to the structure
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 19 Jan 2021 17:07:12 +0000 (17:07 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 19 Jan 2021 17:11:26 +0000 (17:11 +0000)
src/libserver/html.c

index ccc7f310d09340bf1e4e6ad0f9e9f24151923cb4..d907995acb40745b81c66709de63f541b06fbc87 100644 (file)
@@ -939,10 +939,18 @@ rspamd_html_process_tag (rspamd_mempool_t *pool, struct html_content *hc,
                /* Inline tag */
                parent = (*cur_level)->data;
 
-               if (parent && (parent->flags & (CM_HEAD|CM_UNKNOWN|FL_IGNORE))) {
-                       tag->flags |= FL_IGNORE;
+               if (parent) {
+                       if (hc->total_tags < max_tags) {
+                               nnode = g_node_new (tag);
+                               g_node_append (*cur_level, nnode);
 
-                       return FALSE;
+                               hc->total_tags ++;
+                       }
+                       if ((parent->flags & (CM_HEAD|CM_UNKNOWN|FL_IGNORE))) {
+                               tag->flags |= FL_IGNORE;
+
+                               return FALSE;
+                       }
                }
        }