From 4af6be3d79dcb5fed8f10196982eac4ac9e738ff Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 30 Apr 2015 18:36:46 +0100 Subject: [PATCH] Remove ugly tld detection. --- src/plugins/lua/phishing.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/lua/phishing.lua b/src/plugins/lua/phishing.lua index 21418f385..78d3b2099 100644 --- a/src/plugins/lua/phishing.lua +++ b/src/plugins/lua/phishing.lua @@ -41,7 +41,7 @@ function phishing_cb (task) local found = false local purl = url:get_phished() if table.maxn(strict_domains) > 0 then - local _,_,tld = string.find(purl:get_host(), '([a-zA-Z0-9%-]+%.[a-zA-Z0-9%-]+)$') + local tld = purl:get_tld() if tld then for _,rule in ipairs(strict_domains) do if rule['map']:get_key(tld) then @@ -53,7 +53,7 @@ function phishing_cb (task) end if not found then if domains then - local _,_,tld = string.find(purl:get_host(), '([a-zA-Z0-9%-]+%.[a-zA-Z0-9%-]+)$') + local tld = purl:get_tld() if tld then if domains:get_key(tld) then task:insert_result(symbol, 1, purl:get_host()) -- 2.39.5