![]() |
|
Thread Tools |
#1
|
||||
|
||||
Disallow Space in Username
Hello folks,
I have googled this already before coming here, and my research has not been successful. I know how to accomplish this through modifying the code, but I want to minimize modifying vbulletin standard code to keep the files scalable with updates. I use the Username Regular Expression : ^[A-Z0-9] Which the help function suggests disallows spaces. However, users are still popping up with spaces in their usernames. No members have liked this post.
|
#2
|
|||
|
|||
Use a different test. http://php.net/manual/en/function.strpos.php
__________________
Add a photo gallery garage to your auto forum and get noticed by your members. Find out how at the vBulletin Computer Help Forum. An informed rider makes their first destination the motorcycle forum at rider info. No members have liked this post.
|
#3
|
||||
|
||||
I think the expression should be
If you leave off the +$ then it's only saying that the name has to start with a letter or number. But you should be aware that if you use that expression, then names can only contain letters or numbers (and no other symbols), so you would need to add any other symbols you want to allow. Of course, none of this will affect any existing names. The following members like this post: Lynne
Last edited by kh99; 22 Jan 2014 at 19:01. Reason: clarified part about other symbols |
#4
|
||||
|
||||
Originally Posted by kh99
This may be the problem; I will let you know.![]()
I appreciate the response. No members have liked this post.
|
#5
|
|||
|
|||
You both forgot lower case letters and a few other characters. Just saying.
__________________
Add a photo gallery garage to your auto forum and get noticed by your members. Find out how at the vBulletin Computer Help Forum. An informed rider makes their first destination the motorcycle forum at rider info. No members have liked this post.
|
#6
|
||||
|
||||
Originally Posted by noppid
The code where that option is used looks like this:![]()
The 'i' in the siU at the end means ignore case, so that expression will allow lower case. I did mention that no other characters would be allowed, but I added to that post in case it wasn't clear what I meant. No members have liked this post.
Last edited by kh99; 22 Jan 2014 at 19:00. |
#7
|
||||
|
||||
So if I put this code "^[A-Z0-9]+$" to Username Regular Expression in vBulletin Options, that should be worked? So user cannnot make username that has space in it. Am I right?
The following members like this post: TheLastSuperman
|
#8
|
|||
|
|||
Originally Posted by kh99
I guess I can shorten my regex then. ![]()
![]() Thanks for pointing out that code @Kh99. I had no idea they appended to the regular expression. I learn at least 10 things every day around here. No members have liked this post.
Last edited by tbworld; 30 Jan 2014 at 09:45. |
#9
|
|||
|
|||
Yes. A user should then only be able to create a user name with letters and numbers only.
The following members like this post: TheLastSuperman
|
![]() |
«
Previous Thread
|
Next Thread
»
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
|
|
New To Site? | Need Help? |
All times are GMT. The time now is 05:44.