From: Vsevolod Stakhov Date: Tue, 17 Aug 2021 11:14:10 +0000 (+0100) Subject: [Minor] Add `invisible` flag to url structure X-Git-Tag: 3.0~3 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=eb60784ac2d3514bba1af00750f40ce1ff74389a;p=rspamd.git [Minor] Add `invisible` flag to url structure --- diff --git a/src/libserver/url.c b/src/libserver/url.c index 139252df4..a56ee8b17 100644 --- a/src/libserver/url.c +++ b/src/libserver/url.c @@ -244,6 +244,7 @@ struct rspamd_url_flag_name { {"no_tld", RSPAMD_URL_FLAG_NO_TLD, -1}, {"truncated", RSPAMD_URL_FLAG_TRUNCATED, -1}, {"redirect_target", RSPAMD_URL_FLAG_REDIRECT_TARGET, -1}, + {"invisible", RSPAMD_URL_FLAG_INVISIBLE, -1}, }; diff --git a/src/libserver/url.h b/src/libserver/url.h index 4ace18f1a..8fdddaca8 100644 --- a/src/libserver/url.h +++ b/src/libserver/url.h @@ -41,6 +41,8 @@ enum rspamd_url_flags { RSPAMD_URL_FLAG_NO_TLD = 1u << 22u, RSPAMD_URL_FLAG_TRUNCATED = 1u << 23u, RSPAMD_URL_FLAG_REDIRECT_TARGET = 1u << 24u, + RSPAMD_URL_FLAG_INVISIBLE = 1u << 25u, + }; #define RSPAMD_URL_MAX_FLAG_SHIFT (25u) diff --git a/src/lua/lua_mimepart.c b/src/lua/lua_mimepart.c index 66b588e3a..f403313a1 100644 --- a/src/lua/lua_mimepart.c +++ b/src/lua/lua_mimepart.c @@ -2116,7 +2116,7 @@ lua_mimepart_get_urls (lua_State * L) } if (!lua_url_cbdata_fill (L, 2, &cb, default_protocols_mask, - ~(0), max_urls)) { + ~(RSPAMD_URL_FLAG_INVISIBLE), max_urls)) { return luaL_error (L, "invalid arguments"); } diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index eacf1bd15..42dbbae25 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -2462,7 +2462,8 @@ lua_task_get_urls (lua_State * L) /* Exclude RSPAMD_URL_FLAG_CONTENT to preserve backward compatibility */ if (!lua_url_cbdata_fill (L, 2, &cb, default_protocols_mask, - ~(RSPAMD_URL_FLAG_CONTENT|RSPAMD_URL_FLAG_IMAGE), max_urls)) { + ~(RSPAMD_URL_FLAG_CONTENT|RSPAMD_URL_FLAG_IMAGE|RSPAMD_URL_FLAG_INVISIBLE), + max_urls)) { return luaL_error (L, "invalid arguments"); } @@ -2734,7 +2735,8 @@ lua_task_get_emails (lua_State * L) } if (!lua_url_cbdata_fill (L, 2, &cb, PROTOCOL_MAILTO, - ~(RSPAMD_URL_FLAG_CONTENT|RSPAMD_URL_FLAG_IMAGE), max_urls)) { + ~(RSPAMD_URL_FLAG_CONTENT|RSPAMD_URL_FLAG_IMAGE|RSPAMD_URL_FLAG_INVISIBLE), + max_urls)) { return luaL_error (L, "invalid arguments"); }