aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-07-03 12:39:43 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-07-03 12:39:43 +0100
commitbf974d701dc8a385e9a3e24909899088736429f6 (patch)
tree6119d02d75370143909d64e1c41b6067d825ada3
parent3f6efef9c2e6dcc7c7988af5ca3ce1e08f5bdd33 (diff)
downloadrspamd-bf974d701dc8a385e9a3e24909899088736429f6.tar.gz
rspamd-bf974d701dc8a385e9a3e24909899088736429f6.zip
[Fix] Fix specific urls extraction
-rw-r--r--lualib/lua_util.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/lualib/lua_util.lua b/lualib/lua_util.lua
index cf4636aa2..5bf8dc026 100644
--- a/lualib/lua_util.lua
+++ b/lualib/lua_util.lua
@@ -559,8 +559,10 @@ exports.extract_specific_urls = function(task, lim, need_emails, filter, prefix)
-- We can get urls based on their eslds
while lim > 0 do
for _,lurls in pairs(eslds) do
- table.insert(res, table.remove(lurls))
- lim = lim - 1
+ if #lurls > 0 then
+ table.insert(res, table.remove(lurls))
+ lim = lim - 1
+ end
end
end
@@ -571,8 +573,10 @@ exports.extract_specific_urls = function(task, lim, need_emails, filter, prefix)
if ntlds <= lim then
while lim > 0 do
for _,lurls in pairs(tlds) do
- table.insert(res, table.remove(lurls))
- lim = lim - 1
+ if #lurls > 0 then
+ table.insert(res, table.remove(lurls))
+ lim = lim - 1
+ end
end
end