Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

[SOLVED] Invalid "Dotted" usernames issue.

Asked Modified Viewed 3,474 times
S
softgil
S
Windows is easier than Linux, just like crapping in your pants is easier than going to the bathroom.
Unknown
  • Junior Member, joined since
  • Contributed 28 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
asked
Junior Member

Hello everyone.

I'm having an issue with "dotted" usernames.

I have an user that would like to subscribe in my forum with a username like aaaa.bbb

In the registration process the form tells him that aaaa.bbb is not allowed because contains invalid characters.

He registered with a different name and I went into the mySQL database and tweaked the users table for is entry from xxxxxxx to aaaa.bbb so he can login. It worked. He can loging now with the username he wanted.

However, he tried to add an avatar and edit his profile. He was given a message that username is not allowed.

My question: can someone, please, tell me how to change all php code in all forms so I can allow users to register, login, edit profile and the sort with a username that contains the "." character or other?

I'll be much obliged.

Sincerely.

SoftGil
Edited by softgil on 09-10-2007 17:34,
0 replies

7 posts

C
clarnp49
C
If you design it, it will break.
If you fix it and it's not broke it will be ruined.
If you just walk away you can't make it any worse.
  • Junior Member, joined since
  • Contributed 17 posts on the community forums.
  • Started 4 threads in the forums
answered
Junior Member

softgil,
I know someone will chime in later on this but just a quick warning on the dotted usernames in php and data being entered into mysql.
The period is most of the time used as an escape character for variables, if the usrename is allowed to have periods in it then it could cause the code to stop, that is the reason to the best of the knowledge that it can't be used with form data unless the php code is told to replace the character with something when entering.
I am not familiar enough to tell you where to look but someone else can probably help you out with that, but be careful with slashes and periods in form code with php.
0 replies
S
softgil
S
Windows is easier than Linux, just like crapping in your pants is easier than going to the bathroom.
Unknown
  • Junior Member, joined since
  • Contributed 28 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

Thanks for your input, clarnp49.

This is "strange", however. I recall that phpBB2, phpBB3, IPB, vBulletin, Joomla and other PHP based packages don't seem to have (or they don't care about) this kind of problems.

Nevertheless, I wonder if someone can help me with this issue.

Cheers. :)
0 replies
J
Josso
J
Josso 10
–––
Without faith, nothing is possible. With it, nothing is impossible
  • Senior Member, joined since
  • Contributed 309 posts on the community forums.
  • Started 1 thread in the forums
answered
Senior Member

Hmm. Not sure but... Try to find this line in includes/update_profile_include.php :
if (!preg_match("/^[-0-9A-Z_@\s]+$/i", $username)) $error .= $locale['481']."<br>\n";

Add a dot:
if (!preg_match("/^[-0-9A-Z_@\s]+$[b][color=#ff0000].[/color][/b]/i", $username)) $error .= $locale['481']."<br>\n";
0 replies
S
slawekneo
S
Sorry for my lang.
  • Junior Member, joined since
  • Contributed 10 posts on the community forums.
  • Started 2 threads in the forums
answered
Junior Member

if (!preg_match("/^[-0-9A-Z_@\s[b].[/b]]+$/i", $username)) $error .= $locale['481']."<br>\n";

;)
Edited by slawekneo on 08-10-2007 19:09,
0 replies
S
softgil
S
Windows is easier than Linux, just like crapping in your pants is easier than going to the bathroom.
Unknown
  • Junior Member, joined since
  • Contributed 28 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

Thank you both Josso and Slawekneo, but it's a NO GO for both patches. :(

Even though the message "Profile successfully updated" shows up in the top of the page, the profile is NOT updated with both patches. :(

Also, if a new user wants to register, the following message keep on showing:

Registration failed for the following reason(s):

User name contains invalid characters.

Please Try Again


Any ideas, please?

Cheers.
0 replies
S
slawekneo
S
Sorry for my lang.
  • Junior Member, joined since
  • Contributed 10 posts on the community forums.
  • Started 2 threads in the forums
answered
Junior Member

file register.php line 49
change on this
if (!preg_match("/^[-0-9A-Z_@\s.]+$/i", $username)) $error .= $locale['403']."<br>\n";

0 replies
S
softgil
S
Windows is easier than Linux, just like crapping in your pants is easier than going to the bathroom.
Unknown
  • Junior Member, joined since
  • Contributed 28 posts on the community forums.
  • Started 7 threads in the forums
  • Started this discussions
answered
Junior Member

Hi there, slawekneo.

Things now working ok with both scenarios; registration and profile editing.

Thanks a zillion for your kind help.

Cheers and all the best, buddy.;)

SoftGil


0 replies

Labels

None yet

Statistics

  • Views 0 views
  • Posts 7 posts
  • Votes 0 votes
  • Topic users 4 members

0 participants

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet