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
437 stars 117 forks source link

globaltools.dk checking issue #200

Closed andrii-pukhalevych closed 1 year ago

andrii-pukhalevych commented 1 year ago

PHP-Whois version: 4.1.8

PHP version: 7.4, 8.1

Description
Request of whois info for globaltools.dk produces error strtolower() expects parameter 1 to be string, bool given in src/Iodev/Whois/Helpers/TextHelper.php, line 15

How to reproduce

$whois = \Iodev\Whois\Factory::get()->createWhois();
$whoisInfo = $whois->loadDomainInfo($Entity->domain);

Possible Solution
Issue happens after adding declare(strict_types=1); in TextHelper.php. A possible solution is cast to string: $srcEncoding = strtolower((string)mb_detect_encoding($text));

io-developer commented 1 year ago

Thanks! Fixed in https://github.com/io-developer/php-whois/commit/da224558cc50efc133d394c94556828f64884c24