Browse Source

Ignore SGML style tags in html.

tags/0.7.5
Vsevolod Stakhov 9 years ago
parent
commit
46acf7be57
2 changed files with 7 additions and 1 deletions
  1. 5
    1
      src/libserver/html.c
  2. 2
    0
      src/libserver/html.h

+ 5
- 1
src/libserver/html.c View 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) {

+ 2
- 0
src/libserver/html.h View 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;

Loading…
Cancel
Save