aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Lewis <nerf@judo.za.org>2017-01-27 12:58:29 +0200
committerAndrew Lewis <nerf@judo.za.org>2017-01-27 12:58:29 +0200
commitfed98781519847d92ce4215b50b9999a89084aef (patch)
treedc1ebbdc57ff4521fce2eba315b1e0914cac19c7
parent7eaea1233c1eafa050bace27ec52bf17d74389a4 (diff)
downloadrspamd-fed98781519847d92ce4215b50b9999a89084aef.tar.gz
rspamd-fed98781519847d92ce4215b50b9999a89084aef.zip
[Minor] URL reputation: fix partial saving of tags
-rw-r--r--src/plugins/lua/url_reputation.lua20
1 files changed, 8 insertions, 12 deletions
diff --git a/src/plugins/lua/url_reputation.lua b/src/plugins/lua/url_reputation.lua
index 75d8fd5aa..85f5bc9f1 100644
--- a/src/plugins/lua/url_reputation.lua
+++ b/src/plugins/lua/url_reputation.lua
@@ -131,19 +131,15 @@ for i = 1, #res do
if not idx then
return redis.error_reply('bad arguments')
end
- local t_str = string.sub(ARGV[i], 1, idx - 1)
+ local t = string.sub(ARGV[i], 1, idx - 1)
local m_str = string.sub(ARGV[i], idx + 1)
- local mm = string.gmatch(m_str, '[^,]+')
- for t in string.gmatch(t_str, '[^,]+') do
- if not tmp1[t] then
- tmp1[t] = {now, {}}
- else
- tmp1[t][1] = now
- end
- local mt_str = mm()
- for mt in string.gmatch(mt_str, '[^,]+') do
- tmp1[t][2][mt] = true
- end
+ if not tmp1[t] then
+ tmp1[t] = {now, {}}
+ else
+ tmp1[t][1] = now
+ end
+ for mt in string.gmatch(m_str, '[^,]+') do
+ tmp1[t][2][mt] = true
end
for k, v in pairs(tmp1) do
local meta_list = {}