Skip to content

Commit

Permalink
PropertyModifierGetHostByName: Transform host name to in_addr represe…
Browse files Browse the repository at this point in the history
…ntation only if it is an ip address
  • Loading branch information
raviks789 committed Aug 6, 2024
1 parent 428a49f commit ffd37ca
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 = $host;
}

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

0 comments on commit ffd37ca

Please sign in to comment.