php-whois icon indicating copy to clipboard operation
php-whois copied to clipboard

Some domains trigger a "PHP warning: preg_match() expects parameter 2 to be string, array given"

Open arall opened this issue 2 years ago • 1 comments

PHP-Whois version: 4.1.2

PHP version: 7.4.22

Description

PHP Warning:  preg_match() expects parameter 2 to be string, array given in <redacted>/vendor/io-developer/php-whois/src/Iodev/Whois/Modules/Tld/Parsers/BlockParser.php on line 428

Warning: preg_match() expects parameter 2 to be string, array given in <redacted>/io-developer/php-whois/src/Iodev/Whois/Modules/Tld/Parsers/BlockParser.php on line 428
PHP Warning:  preg_match() expects parameter 2 to be string, array given in <redacted>/vendor/io-developer/php-whois/src/Iodev/Whois/Modules/Tld/Parsers/BlockParser.php on line 428

Warning: preg_match() expects parameter 2 to be string, array given in <redacted>/vendor/io-developer/php-whois/src/Iodev/Whois/Modules/Tld/Parsers/BlockParser.php on line 428

How to reproduce

<?php
include 'vendor/autoload.php';

use Iodev\Whois\Factory;

$whois = Factory::get()->createWhois();
$res = $whois->isDomainAvailable('cloudflare.com');
echo $res ? 'Available' : 'Not available';

arall avatar Aug 10 '21 10:08 arall

I think it's related to #153

bessone avatar Aug 19 '21 15:08 bessone