Disallow usernames with less than 3 characters
authorTim Düsterhus <timwolla@googlemail.com>
Sun, 17 Feb 2013 14:36:06 +0000 (15:36 +0100)
committerTim Düsterhus <timwolla@googlemail.com>
Sun, 17 Feb 2013 14:36:06 +0000 (15:36 +0100)
cf. #1144

wcfsetup/install/files/lib/util/UserUtil.class.php

index 327707048bd6e5d237fc15d9a7df8194e84f195b..c3554e2b478a545fca8a9c9a66f426f531bb1c57 100644 (file)
@@ -20,6 +20,11 @@ final class UserUtil {
         * @return      boolean
         */
        public static function isValidUsername($name) {
+               // minimum length are 3 characters
+               if (StringUtil::length($name) < 3) {
+                       return false;
+               }
+               
                // check illegal characters
                if (!preg_match('!^[^,\n]+$!', $name)) {
                        return false;