Closed hlorofos closed 3 years ago
The main cause of this error is related to parsing the owner function
in Iodev\Whois\Modules\Tld\Parsers\BlockParser
the function is :
protected function parseOwner(GroupFilter $rootFilter, GroupFilter $primaryFilter)
{
$owner = $rootFilter->cloneMe()
->useMatchFirstOnly(true)
->filterHasSubsetOf($this->ownerSubsets)
->toSelector()
->selectKeys($this->ownerKeys)
->getFirst('');
if (empty($owner)) {
$owner = $primaryFilter->toSelector()
->selectKeys($this->ownerKeys)
->getFirst('');
}
if (!empty($owner)) {
$owner = $rootFilter->cloneMe()
->setSubsetParams(['$id' => $owner])
->useMatchFirstOnly(true)
->filterHasSubsetOf($this->contactSubsets)
->toSelector()
->selectKeys($this->contactOrgKeys)
->selectItems([ $owner ])
->removeEmpty()
->getFirst('');
}
return $owner;
}
now this section
if (!empty($owner)) {
$owner = $rootFilter->cloneMe()
->setSubsetParams(['$id' => $owner])
->useMatchFirstOnly(true)
->filterHasSubsetOf($this->contactSubsets)
->toSelector()
->selectKeys($this->contactOrgKeys)
->selectItems([ $owner ])
->removeEmpty()
->getFirst('');
}
is the one which throw the error if the $owner
data was an array, the simple fix would be to change the if statement to something like
if (!empty($owner) && !is_array($owner)) {
for sure this is a duck-tape solution, which needs to be investigated more
Can't reproduce. Possibly already fixed in master after parsing improvements.
PHP-Whois version: 3.4.3
PHP version: 7.3.9
Description
Module is throwing exception when using
loadDomainInfo
ErrorException: Array to string conversion in /var/www/vendor/io-developer/php-whois/src/Iodev/Whois/Helpers/GroupHelper.php:142How to reproduce
Additional context