From: Vsevolod Stakhov Date: Mon, 4 Jun 2018 15:50:48 +0000 (+0100) Subject: [Fix] Fix matching patterns with no paths X-Git-Tag: 1.7.6~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2c78d1b079e5880b908b27bebebb2a140ae2d4b;p=thirdparty%2Frspamd.git [Fix] Fix matching patterns with no paths --- diff --git a/src/plugins/lua/phishing.lua b/src/plugins/lua/phishing.lua index e76ffc79ae..69aec219f7 100644 --- a/src/plugins/lua/phishing.lua +++ b/src/plugins/lua/phishing.lua @@ -75,8 +75,12 @@ local function phishing_cb(task) for _,d in ipairs(elt) do if not d['path'] then found_path = true + end + + if query and d['query'] and query == d['query'] then + found_query = true + elseif not d['query'] then found_query = true - break end end end @@ -101,7 +105,10 @@ local function phishing_cb(task) task:insert_result(phish_symbol, 1.0, args) else -- Host + path match - task:insert_result(phish_symbol, 0.3, args) + if path then + task:insert_result(phish_symbol, 0.3, args) + end + -- No path, no symbol end else if url:is_phished() then