io-developer / php-whois

PHP WHOIS provides parsed and raw whois lookup of domains and ASN routes. PHP 8.0 compatible (5.4+ old versions)
MIT License
438 stars 117 forks source link

IDN domains aren't working #130

Closed emildayan closed 3 years ago

emildayan commented 4 years ago

PHP-Whois version: 4.0

PHP version: 7.3.0

Description
IDN/Punycode domains are not returning any data.

How to reproduce

$resolver = Iodev\Whois\Factory::get()->createWhois();
$info = Iodev\Whois\Whois::create()->loadDomainInfo('öppettider.se');

Possible Solution
BlockParser->parseResponse is failing on parseDomain. An ugly fix:

if (empty($data['domainName'])) {
            if (strpos($response->domain, 'xn--') !== false) {
                $data['domainName'] = $response->domain;
            }
}
io-developer commented 3 years ago

Fixed in https://github.com/io-developer/php-whois/commit/29df9d6ff74ab10138f632038d38400380ebbc5a