Users running a non-download version of Vanilla (pulled from github), on branch release/2019.016 or master from the last 2 weeks should upgrade to release/2019.017 or latest master for security reasons. Downloaded official open sources releases are not affected.

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!


  • 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...

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    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.