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

Fatal error: Uncaught TypeError: preg_match()

Open ghost opened this issue 1 year ago • 3 comments

PHP-Whois version: 4.1.1(latest)

PHP version: 8.3

Description

PHP Fatal error:  Uncaught TypeError: preg_match(): Argument #2 ($subject) must be of type string, array given in vendor/io-developer/php-whois/src/Iodev/Whois/Modules/Tld/Parsers/BlockParser.php:430
Stack trace:
#0 vendor/io-developer/php-whois/src/Iodev/Whois/Modules/Tld/Parsers/BlockParser.php(430): preg_match()
#1 vendor/io-developer/php-whois/src/Iodev/Whois/Modules/Tld/Parsers/BlockParser.php(364): Iodev\Whois\Modules\Tld\Parsers\BlockParser->parseDate()
#2 vendor/io-developer/php-whois/src/Iodev/Whois/Modules/Tld/Parsers/BlockParser.php(116): Iodev\Whois\Modules\Tld\Parsers\BlockParser->parseCreationDate()
#3 vendor/io-developer/php-whois/src/Iodev/Whois/Modules/Tld/Parsers/AutoParser.php(72): Iodev\Whois\Modules\Tld\Parsers\BlockParser->parseResponse()
#4 vendor/io-developer/php-whois/src/Iodev/Whois/Modules/Tld/TldModule.php(204): Iodev\Whois\Modules\Tld\Parsers\AutoParser->parseResponse()
#5 vendor/io-developer/php-whois/src/Iodev/Whois/Modules/Tld/TldModule.php(178): Iodev\Whois\Modules\Tld\TldModule->loadParsedTo()
#6 vendor/io-developer/php-whois/src/Iodev/Whois/Modules/Tld/TldModule.php(137): Iodev\Whois\Modules\Tld\TldModule->loadDomainData()
#7 vendor/io-developer/php-whois/src/Iodev/Whois/Whois.php(119): Iodev\Whois\Modules\Tld\TldModule->loadDomainInfo()
#8 tld.php(206): Iodev\Whois\Whois->loadDomainInfo()
#9 {main}
  thrown in vendor/io-developer/php-whois/src/Iodev/Whois/Modules/Tld/Parsers/BlockParser.php on line 430

How to reproduce
Absolutely No idea! I'm doing >100k scans and this issue has only popped up less than ten times. Sadly, I did Not capture what domain, what TLD this error occurred on. All I can say, is that it was a ccTLD

Possible Solution
How to fix the root issue? No idea! How to potentially slap a bandaid on it? (untested) && is_string($str) in if ($str && is_string($str) && preg_match($fallbackRegex, $str)) { (BlockParser.php:430)

Additional context
N/a

ghost avatar Mar 08 '24 01:03 ghost

I got preg_match(): Argument #2 ($subject) must be of type string, array given with domain herbalife.by

decadence avatar May 22 '24 10:05 decadence

Image

dmachehin avatar Feb 10 '25 08:02 dmachehin