From 6fec513954e461ec4d3acf9f4d82eee378e6a916 Mon Sep 17 00:00:00 2001 From: sparc Date: Wed, 9 May 2007 07:37:32 +0000 Subject: [PATCH] fixed reporting of ip query information --- Changes.md | 3 +++ src/whois.client.php | 12 ++++++++++-- src/whois.ip.php | 8 ++++---- src/whois.main.php | 1 + 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Changes.md b/Changes.md index 42ac458..f6eabb6 100644 --- a/Changes.md +++ b/Changes.md @@ -1,3 +1,6 @@ +2007/05/09 + - fixed reporting of ip query information + 2007/05/04 - fixes to ip handler and APNIC ip handler diff --git a/src/whois.client.php b/src/whois.client.php index 0bff56d..a7bb4d7 100755 --- a/src/whois.client.php +++ b/src/whois.client.php @@ -260,10 +260,18 @@ class WhoisClient { { $info = array( 'server'=> $this->Query['server'], - 'args' => $this->Query['args'], - 'port' => $this->Query['server_port'] ); + if (!empty($this->Query['args'])) + $info['args'] = $this->Query['args']; + else + $info['args'] = $this->Query['query']; + + if (!empty($this->Query['server_port'])) + $info['port'] = $this->Query['server_port']; + else + $info['port'] = 43; + if (isset($result['regyinfo']['whois'])) unset($result['regyinfo']['whois']); diff --git a/src/whois.ip.php b/src/whois.ip.php index 9ce28c6..0a191c6 100644 --- a/src/whois.ip.php +++ b/src/whois.ip.php @@ -78,7 +78,7 @@ class ip_handler extends WhoisClient $this->Query = array(); $this->Query['server'] = 'whois.arin.net'; - $this->Query['string'] = $query; + $this->Query['query'] = $query; reset($this->REGISTRARS); @@ -150,17 +150,17 @@ class ip_handler extends WhoisClient if ($newquery != '') { - $result = $this->set_whois_info($result); + //$result = $this->set_whois_info($result); $result['regyinfo']['netname'] = $newquery; if (strstr($newquery, 'BRAZIL-BLK')) - { + { $this->Query['server'] = 'whois.registro.br'; $result['regyinfo']['registrar'] = 'Comite Gestor da Internet no Brasil'; $rawdata = $this->GetRawData($query); break; } - + $rawdata = $this->GetRawData('!'.$newquery); } else diff --git a/src/whois.main.php b/src/whois.main.php index 7f6efb8..380f88f 100755 --- a/src/whois.main.php +++ b/src/whois.main.php @@ -108,6 +108,7 @@ class Whois extends WhoisClient // Prepare to do lookup via the 'ip' handler $ip = @gethostbyname($query); $this->Query['server'] = 'whois.arin.net'; + $this->Query['args'] = $ip; $this->Query['host_ip'] = $ip; $this->Query['file'] = 'whois.ip.php'; $this->Query['handler'] = 'ip';