From: Andrew Lewis Date: Fri, 24 Feb 2017 10:06:09 +0000 (+0200) Subject: [Minor] URL tags: fix restoring of tags X-Git-Tag: 1.5.0~37^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2d0ee54a1295245b8c207da554b91ff2e17b1d13;p=rspamd.git [Minor] URL tags: fix restoring of tags --- diff --git a/src/plugins/lua/url_tags.lua b/src/plugins/lua/url_tags.lua index 4718d23d2..346e5a11a 100644 --- a/src/plugins/lua/url_tags.lua +++ b/src/plugins/lua/url_tags.lua @@ -283,22 +283,24 @@ local function tags_restore(task) for i = 1, d_len do if type(data[i]) == 'string' then local tld = tld_reverse[i] - for time, tag, meta in string.gmatch(data[i], '(%d+)|([^|]+)|(.+)') do - if (time + settings.expire) > now then - local metatags = {} - for m in string.gmatch(meta, '[^,]+') do - table.insert(metatags, m) - end - for _, idx in ipairs(tlds[tld]) do - if not tracking[tld] then - tracking[tld] = {} - end - if not tracking[tld][tag] then - tracking[tld][tag] = {} + for goo in string.gmatch(data[i], '[^/]+') do + for time, tag, meta in string.gmatch(goo, '(%d+)|([^|]+)|(.+)') do + if (time + settings.expire) > now then + local metatags = {} + for m in string.gmatch(meta, '[^,]+') do + table.insert(metatags, m) end - for _, ttag in ipairs(metatags) do - urls[idx]:add_tag(tag, ttag, mpool) - tracking[tld][tag][ttag] = true + for _, idx in ipairs(tlds[tld]) do + if not tracking[tld] then + tracking[tld] = {} + end + if not tracking[tld][tag] then + tracking[tld][tag] = {} + end + for _, ttag in ipairs(metatags) do + urls[idx]:add_tag(tag, ttag, mpool) + tracking[tld][tag][ttag] = true + end end end end