diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..4e87ad5 --- /dev/null +++ b/composer.json @@ -0,0 +1,12 @@ +{ + "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", + "require": { + "php": ">=4.3.0" + }, + "autoload": { + "files": ["whois.main.php", "whois.utils.php"] + } +} 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); diff --git a/whois.gtld.php b/whois.gtld.php index d16cef1..6f46bc2 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 ( is_array( $query ) and 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']); @@ -78,4 +81,4 @@ function parse($data, $query) return $this->result; } } -?> \ No newline at end of file +?>