commit d26eaba: [Fix] Do not process links in ignored html tags

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Jan 6 19:56:07 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-01-06 19:49:23 +0000
URL: https://github.com/rspamd/rspamd/commit/d26eaba6097cb8beb52216720b56454c77aff6a0 (HEAD -> master)

[Fix] Do not process links in ignored html tags

---
 src/libserver/html.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/libserver/html.c b/src/libserver/html.c
index 687970baa..c7afc54f9 100644
--- a/src/libserver/html.c
+++ b/src/libserver/html.c
@@ -106,7 +106,7 @@ static struct html_tag_def tag_defs[] = {
 	TAG_DEF(Tag_LABEL, "label", (CM_INLINE)),
 	TAG_DEF(Tag_LEGEND, "legend", (CM_INLINE)),
 	TAG_DEF(Tag_LI, "li", (CM_LIST | CM_OPT | CM_NO_INDENT | FL_BLOCK)),
-	TAG_DEF(Tag_LINK, "link", (CM_HEAD | CM_EMPTY|FL_HREF)),
+	TAG_DEF(Tag_LINK, "link", (CM_EMPTY|FL_HREF)),
 	TAG_DEF(Tag_LISTING, "listing", (CM_BLOCK | CM_OBSOLETE)),
 	TAG_DEF(Tag_MAP, "map", (CM_INLINE|FL_HREF)),
 	TAG_DEF(Tag_MENU, "menu", (CM_BLOCK | CM_OBSOLETE)),
@@ -3192,7 +3192,7 @@ rspamd_html_process_part_full (rspamd_mempool_t *pool,
 					save_space = FALSE;
 				}
 
-				if (cur_tag->flags & FL_HREF) {
+				if (cur_tag->flags & FL_HREF && !(cur_tag->flags & FL_IGNORE)) {
 					if (!(cur_tag->flags & (FL_CLOSING))) {
 						url = rspamd_html_process_url_tag (pool, cur_tag, hc);
 


More information about the Commits mailing list