commit 957e841: [Minor] HTML: Extract urls from `action` attribute

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Feb 2 16:49:06 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-02-02 16:47:21 +0000
URL: https://github.com/rspamd/rspamd/commit/957e841f1d7d045a33f5d363fe81f33370190b20 (HEAD -> master)

[Minor] HTML: Extract urls from `action` attribute

---
 src/libserver/html.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/libserver/html.c b/src/libserver/html.c
index 0dd6eb5cd..5b3aafca0 100644
--- a/src/libserver/html.c
+++ b/src/libserver/html.c
@@ -84,7 +84,7 @@ static struct html_tag_def tag_defs[] = {
 	TAG_DEF(Tag_EM, "em", (CM_INLINE)),
 	TAG_DEF(Tag_FIELDSET, "fieldset", (CM_BLOCK)),
 	TAG_DEF(Tag_FONT, "font", (FL_BLOCK)),
-	TAG_DEF(Tag_FORM, "form", (CM_BLOCK)),
+	TAG_DEF(Tag_FORM, "form", (CM_BLOCK|FL_HREF)),
 	TAG_DEF(Tag_FRAME, "frame", (CM_FRAMES | CM_EMPTY | FL_HREF)),
 	TAG_DEF(Tag_FRAMESET, "frameset", (CM_HTML | CM_FRAMES)),
 	TAG_DEF(Tag_H1, "h1", (CM_BLOCK | CM_HEADING)),
@@ -1000,6 +1000,11 @@ rspamd_html_parse_tag_component (rspamd_mempool_t *pool,
 			NEW_COMPONENT (RSPAMD_HTML_COMPONENT_HREF);
 		}
 	}
+	else if (len == 6) {
+		if (g_ascii_strncasecmp (p, "action", len) == 0) {
+			NEW_COMPONENT (RSPAMD_HTML_COMPONENT_HREF);
+		}
+	}
 
 	if (tag->id == Tag_IMG) {
 		/* Check width and height if presented */


More information about the Commits mailing list