PDA

View Full Version : Prohibit double spaces in username.


Artistichaven
06-18-2012, 04:37 PM
Does anyone know how I could stop users from registering with two or more spaces next to each other in their username?

Andy
06-18-2012, 05:51 PM
I suggest not allowing any spaces at all.

Artistichaven
06-18-2012, 06:18 PM
I suggest not allowing any spaces at all.

I want to allow spaces, just not double spaces.

kh99
06-18-2012, 07:45 PM
What version do you have? I find when I test the latest vb3 version (3.8.7PL2) that although the registration page allows me to enter a username with multiple consecutive spaces, they are removed (condensed to one space) when the user is created. But a while back there was an issue where usernames could be duplicated by including some sort of non-printable characters, and there was a regular expression that was given as a work-around. I don't know if 3.8.7PL2 fixes that in some other way or not.

Artistichaven
06-19-2012, 02:41 PM
I used ^[A-Za-z0-9 ]+$. I tried adding [^( )], but it didn't work. We're using 3.8.7, let me check the double spaces shrinking thing now.

Edit:
My gosh! You're right, it condenses double spaces. :o