Skip to content

Commit

Permalink
Try to detect errors and continue
Browse files Browse the repository at this point in the history
  • Loading branch information
W1zzardTPU committed Dec 2, 2015
1 parent a203689 commit 16f781a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions upload/library/TPUDetectSpamReg/AS.php
Original file line number Diff line number Diff line change
Expand Up @@ -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])))
{
Expand Down

0 comments on commit 16f781a

Please sign in to comment.