summaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-11-14 15:08:02 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-11-14 15:08:02 +0000
commit46acf7be5791a164f8fa5dbc16494d8175e5b850 (patch)
tree16403abc98efcd5955cd83d57172db53c6a31b0b /src/libserver
parent659ff5ca02101ad4d8a9d8eabeb376c44519c7d1 (diff)
downloadrspamd-46acf7be5791a164f8fa5dbc16494d8175e5b850.tar.gz
rspamd-46acf7be5791a164f8fa5dbc16494d8175e5b850.zip
Ignore SGML style tags in html.
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/html.c6
-rw-r--r--src/libserver/html.h2
2 files changed, 7 insertions, 1 deletions
diff --git a/src/libserver/html.c b/src/libserver/html.c
index fdb6a11db..edf831238 100644
--- a/src/libserver/html.c
+++ b/src/libserver/html.c
@@ -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) {
diff --git a/src/libserver/html.h b/src/libserver/html.h
index 6709ed151..1760ad0ca 100644
--- a/src/libserver/html.h
+++ b/src/libserver/html.h
@@ -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;