From fed98781519847d92ce4215b50b9999a89084aef Mon Sep 17 00:00:00 2001 From: Andrew Lewis Date: Fri, 27 Jan 2017 12:58:29 +0200 Subject: [PATCH] [Minor] URL reputation: fix partial saving of tags --- src/plugins/lua/url_reputation.lua | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/plugins/lua/url_reputation.lua b/src/plugins/lua/url_reputation.lua index 75d8fd5aab..85f5bc9f1f 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 = {} -- 2.47.3