PHP-Auth
PHP-Auth copied to clipboard
Make username case insensitive
When logging in by username, the username was case-sensitive. This PR makes it case-insensitive
Thanks!
That’s indeed the behavior we want (case-insensitive).
What database system are you using though? SQLite, I guess?
As far as I remember, that COLLATE NOCASE
in a query would be specific to SQLite, not part of the standard, and incompatible with the other database systems that we support. So we can’t add it there.
But can’t we add COLLATE NOCASE
to the column definitions (of the few affected columns) instead? That would mean we change the schema in Database/SQLite.sql
instead. This could also be a little faster (because indexes are built the right way).
What do you think?
Yes, I am using SQLite3 indeed. Sorry, I thought this statement was only for sqlite. In that case it is probably best to use your way and I will close this PR. Thanks for the feedback! :)
No problem!
Could you test the alternative solution of using COLLATE
on the columns in the schema (and removing it from the query again)? Or aren’t you interested in this anymore (at the moment)?
(I’ll leave this open until any solution for this problem has been implemented.)
I will test it later this week!
Thanks!
It’s the three columns
users.email
users.username
users_confirmations.email
where the COLLATE
clause would have to be added.