commit dd51e04: [Minor] Avoid extra has_symbol call

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Apr 9 18:28:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-04-09 19:27:29 +0100
URL: https://github.com/rspamd/rspamd/commit/dd51e047a9ce33c730e0d810d10c02b4d54b9e06 (HEAD -> master)

[Minor] Avoid extra has_symbol call

---
 src/plugins/lua/phishing.lua | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/plugins/lua/phishing.lua b/src/plugins/lua/phishing.lua
index ed6ffe3bd..86b1d440b 100644
--- a/src/plugins/lua/phishing.lua
+++ b/src/plugins/lua/phishing.lua
@@ -183,8 +183,9 @@ local function phishing_cb(task)
 
   -- Process all urls
   local dmarc_dom
-  if task:has_symbol('DMARC_POLICY_ALLOW') then
-    local dsym = task:get_symbol('DMARC_POLICY_ALLOW')[1]
+  local dsym = task:get_symbol('DMARC_POLICY_ALLOW')
+  if dsym then
+    dsym = dsym[1] -- legacy stuff, need to take the first element
     dmarc_dom = dsym.options[1]
   end
 


More information about the Commits mailing list