On Thu, Jun 19, 2008 at 2:14 AM, <aaron(a)svn.wikimedia.org> wrote:
> Log Message:
> -----------
> Loosen ipv4 check back, this really should be called isLikeIP()
>
> . . .
> static function isIP( $name ) {
> - return IP::isIPAddress($name);
> - /*return preg_match("/^
> - (?:[01]?\d{1,2}|2(:?[0-4]\d|5[0-5]))\.
> - (?:[01]?\d{1,2}|2(:?[0-4]\d|5[0-5]))\.
> - (?:[01]?\d{1,2}|2(:?[0-4]\d|5[0-5]))\.
> - (?:[01]?\d{1,2}|2(:?[0-4]\d|5[0-5]))
> - $/x", $name);*/
> + return preg_match('/^\d{1,3}\.\d{1,3}\.\d{1,3}\.(?:xxx|\d{1,3})$/',$name) || IP::isIPv6($name);
What's the rationale for this change?