| Not logged in - | |
| Moderated by: Jim |
|
||||||||||||||
| & in a username - Bug Reports - News and Announcements - WowUltra Forums | |||||||||||||||
| Author | Post | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||
|
jefe Member
|
Hi jim & Di Is there a way to stop users using the '&' in a user name as we have quite a few members that register E.G. ron&judy when it shows in the new member, who's on line & in the profile it comes out like this ron&judy jefe
|
||||||||||||||
| |||||||||||||||
| |||||||||||||||
|
wingnutter Forever Learning
|
This used to work in WOW 1.7, but don't try it until Jim gives it the green light as I don't know if it works in Ultra; Preventing & being used in usernames, V1.7 or higher (meaning not tested in previous versions) It will prevent the listed special characters from being used in a username. In login.php, you can insert the following line: if (preg_match('/(\'|"|\|)+/', $user_info["user_name"])) error("invalid_username", array("user_names" => stripslashes($user_info["user_name"]))); right above: $user_info["user_theme"] = THEME; All credit to whoever thought it up for WOW, I just copied and saved it.
|
||||||||||||||
| |||||||||||||||
| |||||||||||||||
|
Jim Administrator
|
I thought that was for apostrophes? I don't see the & char in that statement, I'll try it and add it. I believe Aycan did that and Marty posted it. The apostrophe fix is already part of Ultra, however I really should fix the problem eventually so any character can be used.
|
||||||||||||||
| |||||||||||||||
| |||||||||||||||
|
wingnutter Forever Learning
|
Just as well you had a look at it Jim.
|
||||||||||||||
| |||||||||||||||
| |||||||||||||||
|
Jim Administrator
|
OK I was right, that is for quotes and apostrophes. To add this "&" replace that exact line above that is already part of Ultra with this: if (preg_match('/(\'|"|&|\|)+/', $user_info["user_name"])) error("invalid_username", array("user_names" => stripslashes($user_info["user_name"]))); I will have a fix in the next version where we will be able to use special characters without excluding them. Jim
|
||||||||||||||
| |||||||||||||||
| |||||||||||||||
|
wingnutter Forever Learning
|
Thanks Jim. If I read that right, Ultra already excludes "&" from usernames?
|
||||||||||||||
| |||||||||||||||
| |||||||||||||||
|
Jim Administrator
|
No not yet, but I'll put it in on yours since I'm upgrading you tonight. Ultra makes it impossible to include an apostrophe in a name, I didn't even know till this post that the & was a problem! The alternate code I posted will work for excluding the & as well as the apostrophe.
|
||||||||||||||
| |||||||||||||||
| |||||||||||||||
|
wingnutter Forever Learning
|
That's excellent Jim, thanks.
|
||||||||||||||
| |||||||||||||||
| |||||||||||||||
|
jefe Member
|
Have replaced: if (preg_match('/('|"||)+/', $user_info["user_name"])) error("invalid_username", array("user_names" => stripslashes($user_info["user_name"]))); with: if (preg_match('/('|"|&||)+/', $user_info["user_name"])) error("invalid_username", array("user_names" => stripslashes($user_info["user_name"]))); that seems to have stoped the problem thanks Last edited on Tue Jun 10th, 2008 07:09 am by jefe |
||||||||||||||
| |||||||||||||||
| Current time is 02:52 am | |
| WowUltra Forums > News and Announcements > Bug Reports > & in a username | |