commit ac1c49b: [Minor] Set invisible flag on invisible urls

Vsevolod Stakhov vsevolod at highsecure.ru
Tue Aug 17 11:21:05 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-08-17 12:19:37 +0100
URL: https://github.com/rspamd/rspamd/commit/ac1c49b2e8b92edddc73e619c266fd5f981dc32e (HEAD -> master)

[Minor] Set invisible flag on invisible urls

---
 src/libserver/html/html.cxx | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/libserver/html/html.cxx b/src/libserver/html/html.cxx
index 70ccd10b7..715f831d5 100644
--- a/src/libserver/html/html.cxx
+++ b/src/libserver/html/html.cxx
@@ -1236,6 +1236,20 @@ html_append_tag_content(rspamd_mempool_t *pool,
 			}
 		}
 	}
+	else {
+		/* Invisible stuff */
+		if (std::holds_alternative<rspamd_url *>(tag->extra)) {
+			auto *url_enclosed = std::get<rspamd_url *>(tag->extra);
+
+			/*
+			 * TODO: when hash is fixed to include flags we need to remove and add
+			 * url to the hash set
+			 */
+			if (url_enclosed) {
+				url_enclosed->flags |= RSPAMD_URL_FLAG_INVISIBLE;
+			}
+		}
+	}
 
 	calculate_final_tag_offsets();
 


More information about the Commits mailing list