mirror of
https://github.com/Icinga/icingaweb2-module-director.git
synced 2025-07-28 16:24:05 +02:00
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);
|
$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) {
|
if (! $inAddr || strlen($inAddr) !== 4) {
|
||||||
switch ($this->getSetting('on_failure')) {
|
switch ($this->getSetting('on_failure')) {
|
||||||
case 'null':
|
case 'null':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user