nnode);
}
+ if (tag->id == -1) {
+ /* Ignore unknown tags */
+ return FALSE;
+ }
+
tag->parent = *cur_level;
if (!(tag->flags & CM_INLINE)) {
if (!g_ascii_isalpha (*in) && !g_ascii_isspace (*in)) {
hc->flags |= RSPAMD_HTML_FLAG_BAD_ELEMENTS;
state = ignore_bad_tag;
+ tag->id = -1;
+ tag->flags |= FL_BROKEN;
}
else if (g_ascii_isalpha (*in)) {
state = parse_name;
if (tag->name.len == 0) {
hc->flags |= RSPAMD_HTML_FLAG_BAD_ELEMENTS;
+ tag->id = -1;
tag->flags |= FL_BROKEN;
state = ignore_bad_tag;
}
s = rspamd_mempool_alloc (pool, tag->name.len);
memcpy (s, tag->name.start, tag->name.len);
- tag->name.len = rspamd_html_decode_entitles_inplace (
- s,
+ tag->name.len = rspamd_html_decode_entitles_inplace (s,
tag->name.len);
tag->name.start = s;
/* TODO: parse DOCTYPE here */
if (t == '>') {
state = tag_end;
+ /* We don't know a lot about sgml tags, ignore them */
+ cur_tag = NULL;
continue;
}
p ++;