Loosen ipv4 check back, this really should be called isLikeIP()
authorAaron Schulz <aaron@users.mediawiki.org>
Thu, 19 Jun 2008 06:14:53 +0000 (06:14 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Thu, 19 Jun 2008 06:14:53 +0000 (06:14 +0000)
includes/User.php

index 6d8c739..0f6e797 100644 (file)
@@ -431,13 +431,7 @@ class User {
         * @return bool
         */
        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);
        }
 
        /**