Skip to content

Commit

Permalink
PropertyModifierGetHostByName: Fix inet_pton unrecognized address e…
Browse files Browse the repository at this point in the history
…rror for PHP 7.2
  • Loading branch information
raviks789 committed Aug 8, 2024
1 parent 428a49f commit 847f210
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ public function transform($value)
}

$host = gethostbyname($value);
$inAddr = inet_pton($host);
if ($host !== $value) {
$inAddr = inet_pton($host);
} else {
$inAddr = false;
}

if (! $inAddr || strlen($inAddr) !== 4) {
switch ($this->getSetting('on_failure')) {
case 'null':
Expand Down

0 comments on commit 847f210

Please sign in to comment.