Clarified purpose of User::isIP(), see bug 6198.
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 4 Jun 2006 23:48:20 +0000 (23:48 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 4 Jun 2006 23:48:20 +0000 (23:48 +0000)
includes/User.php

index 15d469a..4450b66 100644 (file)
@@ -188,9 +188,14 @@ class User {
        }
 
        /**
-        * does the string match an anonymous IPv4 address?
+        * Does the string match an anonymous IPv4 address?
         *
-        * Note: We match \d{1,3}\.\d{1,3}\.\d{1,3}\.xxx as an anonymous IP
+        * This function exists for username validation, in order to reject
+        * usernames which are similar in form to IP addresses. Strings such
+        * as 300.300.300.300 will return true because it looks like an IP 
+        * address, despite not being strictly valid.
+        * 
+        * We match \d{1,3}\.\d{1,3}\.\d{1,3}\.xxx as an anonymous IP
         * address because the usemod software would "cloak" anonymous IP
         * addresses like this, if we allowed accounts like this to be created
         * new users could get the old edits of these anonymous users.