From c00a403489a10ca8a3796d97c6c42f7bcf48d978 Mon Sep 17 00:00:00 2001 From: Brunet Vincent Date: Thu, 15 Nov 2012 17:50:30 +0100 Subject: [PATCH 1/7] Add pm, re, wf, yt support (AFNIC tlds) --- whois.pm.php | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++ whois.re.php | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++ whois.wf.php | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++ whois.yt.php | 78 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 312 insertions(+) create mode 100644 whois.pm.php create mode 100644 whois.re.php create mode 100644 whois.wf.php create mode 100644 whois.yt.php diff --git a/whois.pm.php b/whois.pm.php new file mode 100644 index 0000000..4d9654c --- /dev/null +++ b/whois.pm.php @@ -0,0 +1,78 @@ + 'fax', + 'e-mail' => 'email', + 'nic-hdl' => 'handle', + 'ns-list' => 'handle', + 'person' => 'name', + 'address' => 'address.', + 'descr' => 'desc', + 'anniversary' => '', + 'domain' => '', + 'last-update' => 'changed', + 'registered' => 'created', + 'country' => 'address.country', + 'registrar' => 'sponsor', + 'role' => 'organization' + ); + + $contacts = array( + 'admin-c' => 'admin', + 'tech-c' => 'tech', + 'zone-c' => 'zone', + 'holder-c' => 'owner', + 'nsl-id' => 'nserver' + ); + + $reg = generic_parser_a($data_str['rawdata'], $translate, $contacts, 'domain','dmY'); + + if (isset($reg['nserver'])) + { + $reg['domain'] = array_merge($reg['domain'],$reg['nserver']); + unset($reg['nserver']); + } + + $r['regrinfo'] = $reg; + $r['regyinfo'] = array( + 'referrer' => 'http://www.nic.fr', + 'registrar' => 'AFNIC' + ); + return $r; + } + } +?> \ No newline at end of file diff --git a/whois.re.php b/whois.re.php new file mode 100644 index 0000000..e44e957 --- /dev/null +++ b/whois.re.php @@ -0,0 +1,78 @@ + 'fax', + 'e-mail' => 'email', + 'nic-hdl' => 'handle', + 'ns-list' => 'handle', + 'person' => 'name', + 'address' => 'address.', + 'descr' => 'desc', + 'anniversary' => '', + 'domain' => '', + 'last-update' => 'changed', + 'registered' => 'created', + 'country' => 'address.country', + 'registrar' => 'sponsor', + 'role' => 'organization' + ); + + $contacts = array( + 'admin-c' => 'admin', + 'tech-c' => 'tech', + 'zone-c' => 'zone', + 'holder-c' => 'owner', + 'nsl-id' => 'nserver' + ); + + $reg = generic_parser_a($data_str['rawdata'], $translate, $contacts, 'domain','dmY'); + + if (isset($reg['nserver'])) + { + $reg['domain'] = array_merge($reg['domain'],$reg['nserver']); + unset($reg['nserver']); + } + + $r['regrinfo'] = $reg; + $r['regyinfo'] = array( + 'referrer' => 'http://www.nic.fr', + 'registrar' => 'AFNIC' + ); + return $r; + } + } +?> \ No newline at end of file diff --git a/whois.wf.php b/whois.wf.php new file mode 100644 index 0000000..5c1fa29 --- /dev/null +++ b/whois.wf.php @@ -0,0 +1,78 @@ + 'fax', + 'e-mail' => 'email', + 'nic-hdl' => 'handle', + 'ns-list' => 'handle', + 'person' => 'name', + 'address' => 'address.', + 'descr' => 'desc', + 'anniversary' => '', + 'domain' => '', + 'last-update' => 'changed', + 'registered' => 'created', + 'country' => 'address.country', + 'registrar' => 'sponsor', + 'role' => 'organization' + ); + + $contacts = array( + 'admin-c' => 'admin', + 'tech-c' => 'tech', + 'zone-c' => 'zone', + 'holder-c' => 'owner', + 'nsl-id' => 'nserver' + ); + + $reg = generic_parser_a($data_str['rawdata'], $translate, $contacts, 'domain','dmY'); + + if (isset($reg['nserver'])) + { + $reg['domain'] = array_merge($reg['domain'],$reg['nserver']); + unset($reg['nserver']); + } + + $r['regrinfo'] = $reg; + $r['regyinfo'] = array( + 'referrer' => 'http://www.nic.fr', + 'registrar' => 'AFNIC' + ); + return $r; + } + } +?> \ No newline at end of file diff --git a/whois.yt.php b/whois.yt.php new file mode 100644 index 0000000..d9b943e --- /dev/null +++ b/whois.yt.php @@ -0,0 +1,78 @@ + 'fax', + 'e-mail' => 'email', + 'nic-hdl' => 'handle', + 'ns-list' => 'handle', + 'person' => 'name', + 'address' => 'address.', + 'descr' => 'desc', + 'anniversary' => '', + 'domain' => '', + 'last-update' => 'changed', + 'registered' => 'created', + 'country' => 'address.country', + 'registrar' => 'sponsor', + 'role' => 'organization' + ); + + $contacts = array( + 'admin-c' => 'admin', + 'tech-c' => 'tech', + 'zone-c' => 'zone', + 'holder-c' => 'owner', + 'nsl-id' => 'nserver' + ); + + $reg = generic_parser_a($data_str['rawdata'], $translate, $contacts, 'domain','dmY'); + + if (isset($reg['nserver'])) + { + $reg['domain'] = array_merge($reg['domain'],$reg['nserver']); + unset($reg['nserver']); + } + + $r['regrinfo'] = $reg; + $r['regyinfo'] = array( + 'referrer' => 'http://www.nic.fr', + 'registrar' => 'AFNIC' + ); + return $r; + } + } +?> \ No newline at end of file From b43935eac55e31a2b9fab67400d567c4ef72ef41 Mon Sep 17 00:00:00 2001 From: alesf Date: Fri, 12 Jul 2013 08:54:59 +0200 Subject: [PATCH 2/7] Name.com whois server changes Name.com whois server changed its whois output. Added semicolons to the dates and added time to the dates. This fixes the issue. --- whois.gtld.name.php | 4 ++-- whois.parser.php | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/whois.gtld.name.php b/whois.gtld.name.php index c6c0101..be0a51d 100644 --- a/whois.gtld.name.php +++ b/whois.gtld.name.php @@ -41,8 +41,8 @@ function parse($data_str, $query) 'billing' => 'BILLING CONTACT INFO', 'domain.name' => 'Domain Name:', 'domain.sponsor' => 'Registrar', - 'domain.created' => 'Creation Date', - 'domain.expires' => 'Expiration Date' + 'domain.created' => 'Creation Date:', + 'domain.expires' => 'Expiration Date:' ); $extra = array( diff --git a/whois.parser.php b/whois.parser.php index d11243a..f4345b9 100755 --- a/whois.parser.php +++ b/whois.parser.php @@ -768,6 +768,11 @@ function format_dates (&$res,$format='mdy') function get_date($date,$format) { + +if(strtotime($date) > 0) { + return date('Y-m-d', strtotime($date)); +} + $months = array( 'jan'=>1, 'ene'=>1, 'feb'=>2, 'mar'=>3, 'apr'=>4, 'abr'=>4, 'may'=>5, 'jun'=>6, 'jul'=>7, 'aug'=>8, 'ago'=>8, 'sep'=>9, 'oct'=>10, 'nov'=>11, 'dec'=>12, 'dic'=>12 ); From 157cfb7375771aa37dab143db6f9aad5d1793f85 Mon Sep 17 00:00:00 2001 From: Matthew Leffler Date: Thu, 6 Feb 2014 17:12:43 -0700 Subject: [PATCH 3/7] Fix bad ref --- whois.gtld.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/whois.gtld.php b/whois.gtld.php index d16cef1..088e70c 100755 --- a/whois.gtld.php +++ b/whois.gtld.php @@ -54,7 +54,10 @@ class gtld_handler extends WhoisClient function parse($data, $query) { $this->Query = array(); - $this->SUBVERSION = sprintf('%s-%s', $query['handler'], $this->HANDLER_VERSION); + if ( array_key_exists( 'handler', $query ) ) + { + $this->SUBVERSION = sprintf('%s-%s', $query['handler'], $this->HANDLER_VERSION); + } $this->result = generic_parser_b($data['rawdata'], $this->REG_FIELDS, 'dmy'); unset($this->result['registered']); From 7d1317720e007344ffc38125c85544c0058cd189 Mon Sep 17 00:00:00 2001 From: Matthew Leffler Date: Thu, 6 Feb 2014 17:46:47 -0700 Subject: [PATCH 4/7] Ensure is array --- whois.gtld.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/whois.gtld.php b/whois.gtld.php index 088e70c..6f46bc2 100755 --- a/whois.gtld.php +++ b/whois.gtld.php @@ -54,7 +54,7 @@ class gtld_handler extends WhoisClient function parse($data, $query) { $this->Query = array(); - if ( array_key_exists( 'handler', $query ) ) + if ( is_array( $query ) and array_key_exists( 'handler', $query ) ) { $this->SUBVERSION = sprintf('%s-%s', $query['handler'], $this->HANDLER_VERSION); } @@ -81,4 +81,4 @@ function parse($data, $query) return $this->result; } } -?> \ No newline at end of file +?> From 9ed821d83ad0338dd7b0cc8e4c4213998b893092 Mon Sep 17 00:00:00 2001 From: Steven Rombauts Date: Mon, 28 Apr 2014 10:46:05 +0200 Subject: [PATCH 5/7] Fix registered status check for .be domains The Belgian DNS provider does not set the "Status" flag to "REGISTERED", but uses one of these three values: "AVAILABLE", "NOT AVAILABLE" and "NOT ALLOWED". See: http://www.dns.be/en/faq/faq_technical#1671 --- whois.be.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/whois.be.php b/whois.be.php index 4d6c9ba..0fb5994 100644 --- a/whois.be.php +++ b/whois.be.php @@ -52,7 +52,7 @@ function parse($data, $query) $r['regrinfo'] = get_blocks($data['rawdata'], $items); - if ($r['regrinfo']['domain']['status'] == 'REGISTERED') + if ($r['regrinfo']['domain']['status'] != 'AVAILABLE') { $r['regrinfo']['registered'] = 'yes'; $r['regrinfo'] = get_contacts($r['regrinfo'],$trans); From 298332f09fd228211e5394a23b6960af3abf112c Mon Sep 17 00:00:00 2001 From: Matthew Leffler Date: Tue, 10 Feb 2015 09:33:29 -0700 Subject: [PATCH 6/7] Add composer.json --- composer.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 composer.json diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..7bb887a --- /dev/null +++ b/composer.json @@ -0,0 +1,12 @@ +{ + "name": "SimpleUpdates/phpwhois", + "type": "library", + "description": "This package contains a Whois (RFC954) library for PHP. It allows a PHP program to create a Whois object, and obtain the output of a whois query with the Lookup function.", + "license": "GPLv2", + "require": { + "php": ">=4.3.0" + }, + "autoload": { + "files": ["whois.main.php", "whois.utils.php"] + } +} From 59daa1a696fdaeca71ffcc9adb93a7730fc5a459 Mon Sep 17 00:00:00 2001 From: Matthew Leffler Date: Tue, 10 Feb 2015 09:36:12 -0700 Subject: [PATCH 7/7] Fix package name --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7bb887a..4e87ad5 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "name": "SimpleUpdates/phpwhois", + "name": "simple-updates/phpwhois", "type": "library", "description": "This package contains a Whois (RFC954) library for PHP. It allows a PHP program to create a Whois object, and obtain the output of a whois query with the Lookup function.", "license": "GPLv2",