From: Vsevolod Stakhov Date: Thu, 30 Apr 2015 17:36:46 +0000 (+0100) Subject: Remove ugly tld detection. X-Git-Tag: 0.9.0~115 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4af6be3d79dcb5fed8f10196982eac4ac9e738ff;p=thirdparty%2Frspamd.git Remove ugly tld detection. --- diff --git a/src/plugins/lua/phishing.lua b/src/plugins/lua/phishing.lua index 21418f385b..78d3b20990 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())