diff --git a/src/whois.ip.php b/src/whois.ip.php index 70e77f4..f834ec4 100644 --- a/src/whois.ip.php +++ b/src/whois.ip.php @@ -91,13 +91,14 @@ class ip_handler extends WhoisClient foreach($rwdata as $line) { + // can be removed ?? if (!strncmp($line,'American Registry for Internet Numbers',38)) continue; $p = strpos($line, '(NETBLK-'); if ($p === false) $p = strpos($line, '(NET-'); - if ($p !== false) + if ($p !== false && strpos($line,'Parent:') === false) { $net = strtok(substr($line,$p+1),') '); 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']); - while (count($this->more_data) > 0) + while (count($this->more_data) > 0) { $srv_data = array_shift($this->more_data); $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