[
https://issues.apache.org/jira/browse/VALIDATOR-421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15959090#comment-15959090
]
Sebb commented on VALIDATOR-421:
--------------------------------
The original description for this issue refers to allowing octal and hex IP
addresses.
As such, it was rejected.
The code was changed after 1.4.0 to reject leading zeros in IPv4 address parts.
It was changed as part of VALIDATOR-307
http://svn.apache.org/viewvc?view=revision&revision=1648274
Unfortunately the issue gives no clue as to why leading zeros were rejected.
I suppose it might have been the possible ambiguity.
> InetAddressValidator IPV4 rejects IPs with leading 0's in octets
> ----------------------------------------------------------------
>
> Key: VALIDATOR-421
> URL: https://issues.apache.org/jira/browse/VALIDATOR-421
> Project: Commons Validator
> Issue Type: Bug
> Components: Routines
> Affects Versions: 1.6
> Reporter: Matt Kusnierz
>
> According to Wikipedia "It [IPv4] also allowed the numbers to be written in
> hexadecimal and octal, by prefixing them with 0x and 0, respectively", but
> org.apache.commons.validator.routines.InetAddressValidator.isValidInet4Address(String)
> rejects IPs if an ipSegment starts with a leading 0.
> So leading 0's should be detected first, and then used to try and parseInt
> using the octal radix.
> The ipv4 regex also doesn't support hex notation.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)