HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

User Names - Can they have spaces or not?

Utter newbie using Vanilla 3.3

I currently have two installations (both are version 3.3). On one installation I can have usernames with spaces in them and according to this:


Spaces are allowed in usernames. The 4 default users (Vanilla Forums, Alex Powell etc) that come with a fresh install have spaces.

However, on one of the Vanilla installations, every time I try to add or change a username I get "Username can only contain letters, numbers, underscores, and must be between 3 and 20 characters long."

One installation was via cPanel (and oddly enough, it's the one that lets me have spaces) and one was a fresh download from here. They're both using the same version of php & MySQL

Anyone had this quirk? Tips appreciated!


  • Options

    Sorry. Now fixed.

    Used the moderation tab to create a new user (admin). Logged in to that user.

    It let me edit the username of the original admin account used for the installation. Problem solved.

    Maybe I'll leave this thread up in case there's anyone else as dense as me...

  • Options
    R_JR_J Ex-Fanboy Munich Admin

    There is a piece of code in Vanilla which validates the user name against a pattern. You can set that pattern in the config so that it allows blanks. This is the code used:

               $defaultPattern = (unicodeRegexSupport()) ? '\p{N}\p{L}\p{M}\p{Pc}' : '\w';
               $validateUsernameRegex = sprintf(
                   c("Garden.User.ValidationRegex", $defaultPattern),
                   c("Garden.User.ValidationLength", "{3,20}")

    Therefore I would advise to add the following line to your /conf/config.php:

    $Configuration['Garden']['User']['ValidationRegex'] = '\p{N}\p{L}\p{M}\p{Pc} ';

Sign In or Register to comment.