-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Simetrical wrote:
On Thu, Jun 19, 2008 at 2:14 AM, aaron@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?
Per the commit message, this restores it to previous behavior, which marked certain IP-like patterns that aren't valid IPs as "IPs" for purposes of, for instance, forbidding them as usernames.
- -- brion