]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix default behaviour of task:get_urls
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 29 Apr 2020 19:08:25 +0000 (20:08 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 29 Apr 2020 19:08:25 +0000 (20:08 +0100)
src/lua/lua_task.c
src/lua/lua_url.c

index 1ca96ed764f2a077acf44d86586583fc6b4a45e9..51936a532f28a4abf7b031450451f273f6c8e864 100644 (file)
@@ -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");
                        }
 
index ed1eb1901fbeb15cdd81fe8494e7dabfcc356016..6652fdaacde7b4af188f4172d689e480138838aa 100644 (file)
@@ -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");