-
Notifications
You must be signed in to change notification settings - Fork 3
Add case insensitivity to email search + test cases #1042
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| SELECT 1 | ||
| FROM {$dbName}.{$table} | ||
| WHERE user_email = :email | ||
| WHERE LOWER(CONVERT(user_email USING utf8mb4)) = LOWER(:email) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks interesting, and it's not immediately obvious to me why it is needed. Can we add a comment above this line to explain it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the table schema, the datatype of the user_email field is tinyblob, so I guess it makes sense (or is maybe even necessary) for the comparison: https://github.com/wbstack/api/blob/main/database/mw/new/mw1.43-wbs2.sql#L1005
edit:
gave it a quick test:
MariaDB root@localhost:mwdb_8127892d75> SELECT user_email FROM mwt_022411e763_user WHERE LOWER(CONVERT(user_email USING utf8mb4)) = LOWER('DENA@DENA.DENA') \G
***************************[ 1. row ]***************************
user_email | Dena@DENA.dena
1 row in set
Time: 0.002s
MariaDB root@localhost:mwdb_8127892d75> SELECT user_email FROM mwt_022411e763_user WHERE LOWER(user_email) = LOWER('DENA@DENA.DENA') \G
0 rows in set
Time: 0.002s
|
can confirm case-insensitive search works in the current state: As Ollie pointed out it would be nice to get the search result string in the output and not the input string, but I can see how this is a bit difficult here because it would need to happen in WikiUserEmailChecker.php |
I suggest we get the case-insensitive stuff merged now, so we can do this GDPR request done before the time runs out, and can think about improvements after. 🙂 |
Follow up from #1042 adding pending changes Bug: T415017
Bug: T415017