The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
apostrophe in their usernames
How can I easily prevent users from registering with an apostrophe in their usernames?
Thanks in advance! Why does no one reply to threads like this? I am posting on the wrong site? |
#2
|
||||
|
||||
You merely need to go into vbulletin settings and add apostrophes to the banned characters for usernames.
|
#3
|
|||
|
|||
and where do I find that? I don't see a Banned Character section
|
#4
|
||||
|
||||
Go to vbulletin options, then to User Registration Options.
Then find Username Regular Expressions. Click on the "help button" in order to view the REGEX codes which allow certain characters. I will go ahead and paste the contents of the helpbutton. Code:
^[A-Z]+$ - Characters from A-Z only ^[A-Z ]+$ - Characters from A-Z including space ^[A-Z0-9 ]+$ - Alphanumeric characters including space ^[\x20-\x7E]+$ - ASCII characters from 32-127 |
#5
|
|||
|
|||
Quote:
|
#6
|
||||
|
||||
You would be best choosing one of the options.
^[A-Z0-9 ]+$ Would allow all letters, numbers, and spaces, while disallowing all other characters. Is there a specific reason why you only want to ban apostrophes? |
#7
|
|||
|
|||
If you try to register with an apostrophe, you get a DB error because it breaks the MySQL query. You also can't administer a user account with an apostrophe in it. vB should ban it by default, or take this into account, but apparently they don't.
I used the regex to only allow letters, numbers and spaces, but the problem now is that if you use something other than those, it doesn't tell you that's why you get an error, it says "that username already exists", which isn't true. |
#8
|
||||
|
||||
It is... all vBulletin input fields are cleaned to prevent such things.
|
#9
|
||||
|
||||
^--- I'm pretty sure apostrophes work in usernames.
It sounds like you have a poorly made mod installed. |
#10
|
||||
|
||||
Apostrophes should be OK. You should rarely have to deal with the username though - that is what the userid column is for.
Anyway, to escape it: PHP Code:
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|