From: Vsevolod Stakhov Date: Wed, 29 Apr 2020 19:08:25 +0000 (+0100) Subject: [Minor] Fix default behaviour of task:get_urls X-Git-Tag: 2.6~475 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=89db3241edf1fcb5856882acf95b7f5f54eea71a;p=rspamd.git [Minor] Fix default behaviour of task:get_urls --- diff --git a/src/lua/lua_task.c b/src/lua/lua_task.c index 1ca96ed76..51936a532 100644 --- a/src/lua/lua_task.c +++ b/src/lua/lua_task.c @@ -2274,7 +2274,7 @@ 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), max_urls)) { + ~(RSPAMD_URL_FLAG_CONTENT|RSPAMD_URL_FLAG_IMAGE), max_urls)) { return luaL_error (L, "invalid arguments"); } @@ -2433,7 +2433,7 @@ lua_task_get_emails (lua_State * L) if (task) { if (task->message) { if (!lua_url_cbdata_fill (L, 2, &cb, PROTOCOL_MAILTO, - (~RSPAMD_URL_FLAG_CONTENT), max_urls)) { + ~(RSPAMD_URL_FLAG_CONTENT|RSPAMD_URL_FLAG_IMAGE), max_urls)) { return luaL_error (L, "invalid arguments"); } diff --git a/src/lua/lua_url.c b/src/lua/lua_url.c index ed1eb1901..6652fdaac 100644 --- a/src/lua/lua_url.c +++ b/src/lua/lua_url.c @@ -1035,6 +1035,9 @@ lua_url_cbdata_fill (lua_State *L, flags_mask &= ~RSPAMD_URL_FLAG_IMAGE; } } + else { + flags_mask &= ~RSPAMD_URL_FLAG_IMAGE; + } lua_pop (L, 1); lua_getfield (L, pos, "content"); @@ -1046,6 +1049,9 @@ lua_url_cbdata_fill (lua_State *L, flags_mask &= ~RSPAMD_URL_FLAG_CONTENT; } } + else { + flags_mask &= ~RSPAMD_URL_FLAG_CONTENT; + } lua_pop (L, 1); lua_getfield (L, pos, "max_urls");