Skip to content

Commit

Permalink
Check the element is a number strictly using /[0-9]/ instead of "\d" #…
Browse files Browse the repository at this point in the history
  • Loading branch information
azumakuniyuki committed Dec 22, 2024
1 parent 06a3af3 commit 822cff6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Sisimai/RFC791.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ sub is_ipv4address {

for my $e ( @octet ) {
# Check each octet is between 0 and 255
return 0 unless $e =~ /\A\d+\z/;
return 0 unless $e =~ /\A[0-9]{1,3}\z/;
my $v = int $e;
return 0 if $v < 0 || $v > 255;
}
Expand Down

0 comments on commit 822cff6

Please sign in to comment.