diff --git a/library/Director/PropertyModifier/PropertyModifierGetHostByName.php b/library/Director/PropertyModifier/PropertyModifierGetHostByName.php index d7921dea5..f178697d2 100644 --- a/library/Director/PropertyModifier/PropertyModifierGetHostByName.php +++ b/library/Director/PropertyModifier/PropertyModifierGetHostByName.php @@ -34,7 +34,14 @@ public function transform($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) { switch ($this->getSetting('on_failure')) { case 'null':