Skip to content

Commit

Permalink
refactor(ci): revert changes
Browse files Browse the repository at this point in the history
  • Loading branch information
xHeaven committed Jan 18, 2025
1 parent 0d49727 commit edb603e
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/Tempest/Validation/src/Rules/IPv6.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@ public function __construct(

public function isValid(mixed $value): bool
{
/**
* Fix for Windows
*
* @see https://github.com/tempestphp/tempest-framework/actions/runs/12807071926/job/35706856702?pr=884
*/
if ($this->options & FILTER_FLAG_NO_RES_RANGE && $this->isReservedIPv6($value)) {
return false;
}

return boolval(filter_var($value, FILTER_VALIDATE_IP, $this->options));
}

Expand All @@ -58,11 +49,4 @@ public function message(): string
empty($additions) ? '' : ' that is ' . implode(' and ', $additions)
);
}

private function isReservedIPv6(string $ipv6): bool
{
$ipBin = inet_pton($ipv6);

return $ipBin !== false && str_starts_with(inet_pton('2001:db8::'), substr($ipBin, 0, 4));
}
}

0 comments on commit edb603e

Please sign in to comment.