Fixed ARIN detection
This commit is contained in:
parent
d54fbfc3e7
commit
18849d1a98
1 changed files with 6 additions and 2 deletions
|
@ -91,13 +91,14 @@ class ip_handler extends WhoisClient
|
||||||
|
|
||||||
foreach($rwdata as $line)
|
foreach($rwdata as $line)
|
||||||
{
|
{
|
||||||
|
// can be removed ??
|
||||||
if (!strncmp($line,'American Registry for Internet Numbers',38)) continue;
|
if (!strncmp($line,'American Registry for Internet Numbers',38)) continue;
|
||||||
|
|
||||||
$p = strpos($line, '(NETBLK-');
|
$p = strpos($line, '(NETBLK-');
|
||||||
|
|
||||||
if ($p === false) $p = strpos($line, '(NET-');
|
if ($p === false) $p = strpos($line, '(NET-');
|
||||||
|
|
||||||
if ($p !== false)
|
if ($p !== false && strpos($line,'Parent:') === false)
|
||||||
{
|
{
|
||||||
$net = strtok(substr($line,$p+1),') ');
|
$net = strtok(substr($line,$p+1),') ');
|
||||||
list($low,$high) = explode('-',str_replace(' ','',substr($line,$p+strlen($net)+3)));
|
list($low,$high) = explode('-',str_replace(' ','',substr($line,$p+strlen($net)+3)));
|
||||||
|
@ -132,7 +133,7 @@ class ip_handler extends WhoisClient
|
||||||
|
|
||||||
unset($this->Query['args']);
|
unset($this->Query['args']);
|
||||||
|
|
||||||
while (count($this->more_data) > 0)
|
while (count($this->more_data) > 0)
|
||||||
{
|
{
|
||||||
$srv_data = array_shift($this->more_data);
|
$srv_data = array_shift($this->more_data);
|
||||||
$this->Query['server'] = $srv_data['server'];
|
$this->Query['server'] = $srv_data['server'];
|
||||||
|
@ -158,6 +159,9 @@ class ip_handler extends WhoisClient
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Just to be sure we get the origianl output if something goes wrong
|
||||||
|
|
||||||
|
if (empty($result['rawdata'])) $result['rawdata'] = $rawdata;
|
||||||
|
|
||||||
// Normalize nameserver fields
|
// Normalize nameserver fields
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue