diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-01-27 11:32:44 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-27 11:32:44 +0000 |
commit | 29d5197458ea29a5bc75e171f007c4ab889f0299 (patch) | |
tree | ec0878eb9d31524ca894dbd8e689ddeaddc315ef /src | |
parent | ff2abb2f0bfe973bc0eaec57416d210da8d5dfa0 (diff) | |
parent | fed98781519847d92ce4215b50b9999a89084aef (diff) | |
download | rspamd-29d5197458ea29a5bc75e171f007c4ab889f0299.tar.gz rspamd-29d5197458ea29a5bc75e171f007c4ab889f0299.zip |
Merge pull request #1379 from fatalbanana/tags
[Minor] URL reputation: fix partial saving of tags
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/url_reputation.lua | 20 |
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 = {} |