AJAX Registration Check

Username Case Sensitivity - AJAX Registration Check

Username Case Sensitivity

by thelorax » Fri Jun 23, 2017 6:29 pm

Hello,

I noticed after installing this addon that if someone registers and uses a name that's technically taken but with a different letter case, then the extension will tell them it's available for use.

For example:
1) Registered with the name TheLorax, now TheLorax is taken.
2) Another user inputs the name thelorax into the username field, ajax reports it as not taken.

Any help in fixing this is appreciated. Thank you!
thelorax
Registered User
Posts: 8
Joined: Thu Feb 12, 2015 9:04 pm
Contact:

Re: Username Case Sensitivity

by RMcGirr83 » Fri Jun 23, 2017 7:09 pm

Open the file pcgf/ajaxregistrationcheck/controller/controller.php

FIND

Code: Select all

                        $username_escaped = $this->db->sql_escape($username);
                        // Check if the name is already used
                        $query = 'SELECT username
                                    FROM ' . USERS_TABLE . "
                                    WHERE username = '" . $username_escaped . "'";
REPLACE WITH

Code: Select all

						$clean_username = utf8_clean_string($username);
                        $username_escaped = $this->db->sql_escape($clean_username);

                        // Check if the name is already used
                        $query = 'SELECT username
                                    FROM ' . USERS_TABLE . "
                                    WHERE username_clean = '" . $username_escaped . "'";
though in actuality the extension should use the functions that are already available to do this from within includes/functions_user.php
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored
User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Username Case Sensitivity

by thelorax » Fri Jun 23, 2017 9:34 pm

Thanks for your assistance!

I'm using an unmodified version of includes/functions_user.php from the 01/07/2017 release (3.2.0), not sure if that has any bearing.
thelorax
Registered User
Posts: 8
Joined: Thu Feb 12, 2015 9:04 pm
Contact:

Re: Username Case Sensitivity

by RMcGirr83 » Sat Jun 24, 2017 10:02 am

It doesn't.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored
User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: Username Case Sensitivity

by TrekRed » Fri Aug 02, 2019 10:08 pm

Does not define Russian characters at all in the name field!
He writes that enter the name, although it has already been entered!
TrekRed
Registered User
Posts: 8
Joined: Fri May 17, 2019 6:31 pm
Contact: