]> source.dussan.org Git - rspamd.git/commitdiff
Ignore SGML style tags in html.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 14 Nov 2014 15:08:02 +0000 (15:08 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 14 Nov 2014 15:08:02 +0000 (15:08 +0000)
src/libserver/html.c
src/libserver/html.h

index fdb6a11db465391b990a689a66568fb3fc459d29..edf831238e14b1ade276d538eba469a34c4261ac 100644 (file)
@@ -493,6 +493,10 @@ construct_html_node (rspamd_mempool_t * pool, gchar *text, gsize tag_len)
                html->flags |= FL_XML;
                html->tag = NULL;
        }
+       else if (*text == '!') {
+               html->flags |= FL_SGML;
+               html->tag = NULL;
+       }
        else {
                if (*text == '/') {
                        html->flags |= FL_CLOSING;
@@ -972,7 +976,7 @@ add_html_node (struct rspamd_task *task,
                                part->is_balanced = FALSE;
                        }
                }
-               else {
+               else if ((data->flags & (FL_XML|FL_SGML)) == 0) {
 
                        g_node_append (*cur_level, new);
                        if ((data->flags & FL_CLOSED) == 0) {
index 6709ed151d559faeffb5c89a536cc4e637258b0f..1760ad0cacec8e9c4b25e381a45a8a25f8d6a001 100644 (file)
@@ -192,6 +192,8 @@ typedef enum
 #define FL_CLOSING      (1 << 1)
 /* Fully closed tag (e.g. <a attrs />) */
 #define FL_CLOSED       (1 << 2)
+/* <! SGML tag */
+#define FL_SGML                        (1 << 3)
 
 struct html_tag {
        tag_id_t id;