Set max username length to value complying with database limitations
authorStefan <Stefan_Hahn1@gmx.net>
Fri, 2 Sep 2016 15:39:00 +0000 (17:39 +0200)
committerStefan <Stefan_Hahn1@gmx.net>
Fri, 2 Sep 2016 15:39:00 +0000 (17:39 +0200)
com.woltlab.wcf/option.xml
wcfsetup/install/files/lib/util/UserUtil.class.php

index c29c7384f1924169a8382dfe3805d4b1ef74e235..3dcc445f0a68829b0f2a3e8d86bd8523b9822c08 100644 (file)
@@ -1106,14 +1106,14 @@ Pinterest</defaultvalue>
                                <optiontype>integer</optiontype>
                                <defaultvalue>3</defaultvalue>
                                <minvalue>3</minvalue>
-                               <maxvalue>255</maxvalue>
+                               <maxvalue>100</maxvalue>
                        </option>
                        <option name="register_username_max_length">
                                <categoryname>user.register</categoryname>
                                <optiontype>integer</optiontype>
                                <defaultvalue>25</defaultvalue>
                                <minvalue>3</minvalue>
-                               <maxvalue>255</maxvalue>
+                               <maxvalue>100</maxvalue>
                        </option>
                        <option name="register_username_force_ascii">
                                <categoryname>user.register</categoryname>
index 68c3d6f6ed2f6459850ee01091d9db1aa6c9870a..ab00d6e2a2e49b8e113d357059514d9d7c087c7f 100644 (file)
@@ -18,8 +18,8 @@ final class UserUtil {
         * @return      boolean
         */
        public static function isValidUsername($name) {
-               // minimum length is 3 characters, maximum length is 255 characters
-               if (mb_strlen($name) < 3 || mb_strlen($name) > 255) {
+               // minimum length is 3 characters, maximum length is 100 characters
+               if (mb_strlen($name) < 3 || mb_strlen($name) > 100) {
                        return false;
                }