UltraBB Forums Home 
Search     Members Calendar Help Home
Search by username
Not logged in - Login | Register 

Visit us here:
www.ultrabb.com
www.ultrabb.net
And of course the public support forums at:
www.ultrabb.net/forum

Hope to see you there!


 Moderated by: Jim
New Topic Reply Printer Friendly
& in a username - Bug Reports - News and Announcements - UltraBB Forums
AuthorPost
 Posted: Sat Jun 7th, 2008 11:50 am
PMQuoteReply  
1st Post
jefe
Member


Joined: Wed Nov 21st, 2007
Location: Padul Granada, Spain
Posts: 14
Status: 
Offline
Mana: 
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

Back To Top PMQuoteReply

 Posted: Sat Jun 7th, 2008 07:12 pm
PMQuoteReply  
2nd Post
wingnutter
Forever Learning


Joined: Wed May 14th, 2008
Location: Ireland
Posts: 867
Status: 
Offline
Mana: 
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.

Back To Top PMQuoteReply

 Posted: Sat Jun 7th, 2008 09:02 pm
PMQuoteReply  
3rd Post
Jim
Administrator


Joined: Wed Apr 11th, 2007
Location:  
Posts: 1963
Status: 
Offline
Mana: 
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.

Back To Top PMQuoteReply

 Posted: Sat Jun 7th, 2008 10:13 pm
PMQuoteReply  
4th Post
wingnutter
Forever Learning


Joined: Wed May 14th, 2008
Location: Ireland
Posts: 867
Status: 
Offline
Mana: 
Just as well you had a look at it Jim. ;)

Back To Top PMQuoteReply

 Posted: Sat Jun 7th, 2008 10:42 pm
PMQuoteReply  
5th Post
Jim
Administrator


Joined: Wed Apr 11th, 2007
Location:  
Posts: 1963
Status: 
Offline
Mana: 
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

Back To Top PMQuoteReply

 Posted: Sun Jun 8th, 2008 06:10 pm
PMQuoteReply  
6th Post
wingnutter
Forever Learning


Joined: Wed May 14th, 2008
Location: Ireland
Posts: 867
Status: 
Offline
Mana: 
Thanks Jim. If I read that right, Ultra already excludes "&" from usernames?

Back To Top PMQuoteReply

 Posted: Sun Jun 8th, 2008 08:35 pm
PMQuoteReply  
7th Post
Jim
Administrator


Joined: Wed Apr 11th, 2007
Location:  
Posts: 1963
Status: 
Offline
Mana: 
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.

Back To Top PMQuoteReply

 Posted: Mon Jun 9th, 2008 01:19 pm
PMQuoteReply  
8th Post
wingnutter
Forever Learning


Joined: Wed May 14th, 2008
Location: Ireland
Posts: 867
Status: 
Offline
Mana: 
That's excellent Jim, thanks.

Back To Top PMQuoteReply

 Posted: Tue Jun 10th, 2008 08:09 am
PMQuoteReply  
9th Post
jefe
Member


Joined: Wed Nov 21st, 2007
Location: Padul Granada, Spain
Posts: 14
Status: 
Offline
Mana: 
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 08:09 am by jefe

Back To Top PMQuoteReply

 Posted: Tue Oct 7th, 2008 01:46 pm
PMQuoteReply  
10th Post
wingnutter
Forever Learning


Joined: Wed May 14th, 2008
Location: Ireland
Posts: 867
Status: 
Offline
Mana: 
Jim wrote: 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.
Did you get around to doing this for me Jim? :) I had two people register yesterday with the &.

Back To Top PMQuoteReply

 Posted: Tue Oct 7th, 2008 02:33 pm
PMQuoteReply  
11th Post
sol
Member
 

Joined: Fri Aug 22nd, 2008
Location: Evanston Gardens, South Australia, Australia
Posts: 15
Status: 
Offline
Mana: 
That "&" included in a topic subject line also comes out that way like    Punch&ampJudy

Back To Top PMQuoteReply

 Posted: Tue Oct 7th, 2008 02:43 pm
PMQuoteReply  
12th Post
Di
Customer Service Rep.


Joined: Sat Apr 28th, 2007
Location: Columbus, Ohio USA
Posts: 1242
Status: 
Offline
Mana: 
sol wrote: That "&" included in a topic subject line also comes out that way like    Punch&ampJudy
i believe Jim has mentioned its fixed in the new version, which hasnt been released yet :)

Back To Top PMQuoteReply

 Posted: Tue Oct 7th, 2008 09:21 pm
PMQuoteReply  
13th Post
sol
Member
 

Joined: Fri Aug 22nd, 2008
Location: Evanston Gardens, South Australia, Australia
Posts: 15
Status: 
Offline
Mana: 
Thanks Di, I read that as being only fixed for the User name but then I suppose fix it for that & it should flow through elsewhere.

Back To Top PMQuoteReply

 Posted: Wed Oct 8th, 2008 05:34 pm
PMQuoteReply  
14th Post
wingnutter
Forever Learning


Joined: Wed May 14th, 2008
Location: Ireland
Posts: 867
Status: 
Offline
Mana: 
sol wrote: That "&" included in a topic subject line also comes out that way like    Punch&ampJudy
Yes it always did this even in the original WOW versions. The new version will get rid of it for us. :)

Back To Top PMQuoteReply

Current time is 12:39 am  
UltraBB Forums > News and Announcements > Bug Reports > & in a username



WowUltra 1.15 Copyright © 2007-2008 by Jim Hale
Page processed in 0.2205 seconds (9% database + 91% PHP). 22 queries executed.