PropertyModifierGetHostByName: Fix `inet_pton` unrecognized address error
This commit is contained in:
parent
aaf51452be
commit
6c7918033d
|
@ -34,7 +34,14 @@ class PropertyModifierGetHostByName extends PropertyModifierHook
|
|||
}
|
||||
|
||||
$host = gethostbyname($value);
|
||||
$inAddr = inet_pton($host);
|
||||
|
||||
// Workaround for "inet_pton: unrecognized address" error in PHP 7.2
|
||||
if ($host !== $value) {
|
||||
$inAddr = inet_pton($host);
|
||||
} else {
|
||||
$inAddr = false;
|
||||
}
|
||||
|
||||
if (! $inAddr || strlen($inAddr) !== 4) {
|
||||
switch ($this->getSetting('on_failure')) {
|
||||
case 'null':
|
||||
|
|
Loading…
Reference in New Issue