diff --git a/upload/library/TPUDetectSpamReg/AS.php b/upload/library/TPUDetectSpamReg/AS.php index 400ef8b..0651825 100644 --- a/upload/library/TPUDetectSpamReg/AS.php +++ b/upload/library/TPUDetectSpamReg/AS.php @@ -29,10 +29,13 @@ static function isIPv6($ip) static function getASNameAndNumber($ip, &$asNumber, &$asName) { - if (self::isIPv6($ip)) - $dns=dns_get_record(self::reverseIPv6($ip).'.origin6.asn.cymru.com', DNS_TXT); - else - $dns=dns_get_record(self::reverseIP($ip).'.origin.asn.cymru.com', DNS_TXT); + try + { + if (self::isIPv6($ip)) + $dns=dns_get_record(self::reverseIPv6($ip).'.origin6.asn.cymru.com', DNS_TXT); + else + $dns=dns_get_record(self::reverseIP($ip).'.origin.asn.cymru.com', DNS_TXT); + } catch(Exception $e) {} if ((is_array($dns)) && (isset($dns[0]))) {