Fatal Error in eppInfoHostResponse.php
DECEiFER opened this issue · comments
DECEiFER commented
Hi,
Just letting you know that PHP 8 is throwing an E_ERROR in eppInfoHostResponse.php when array_keys() is run in get_host() due to the return value from getHostAddresses() being null. In PHP <=7 it was just an E_WARNING.
public function getHost() {
$hostname = $this->getHostName();
$address = $this->getHostAddresses();
$address = array_keys($address);
$host = new eppHost($hostname, $address);
return $host;
}
public function getHostAddresses() {
$ip = null;
$xpath = $this->xPath();
$result = $xpath->query('/epp:epp/epp:response/epp:resData/host:infData/host:addr');
foreach ($result as $address) {
/* @var $address \DOMElement */
$ip[$address->nodeValue] = $address->getAttribute('ip');
}
return $ip;
}
I'm modifying it to:
public function getHostAddresses() {
$ip = array();
$xpath = $this->xPath();
$result = $xpath->query('/epp:epp/epp:response/epp:resData/host:infData/host:addr');
foreach ($result as $address) {
/* @var $address \DOMElement */
$ip[$address->nodeValue] = $address->getAttribute('ip');
}
return $ip;
}
Thanks for the excellent work!