]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix matching patterns with no paths
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 4 Jun 2018 15:50:48 +0000 (16:50 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 4 Jun 2018 15:50:48 +0000 (16:50 +0100)
src/plugins/lua/phishing.lua

index e76ffc79aebbc37ff02e53e6d0d9382d5cca6890..69aec219f7bbb6f6c3694ee19d8c5cd42e8406f6 100644 (file)
@@ -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