fix: Use mb_ string operations in planet captcha#213
Merged
grandeljay merged 3 commits intowishthis:developfrom Mar 10, 2025
Merged
fix: Use mb_ string operations in planet captcha#213grandeljay merged 3 commits intowishthis:developfrom
grandeljay merged 3 commits intowishthis:developfrom
Conversation
Updates register.php to use multibyte versions of strtolower/strtoupper for compatibility with non-Latin alphabets. Simplifies the comparison by removing a Sanitise call.
Contributor
Author
|
Me again – added a second commit. The substring handling in |
grandeljay
approved these changes
Mar 10, 2025
Member
grandeljay
left a comment
There was a problem hiding this comment.
LGTM! Thank you for your service!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi!
A user using their browser in Ukrainian reported issues registering an account, with the site not accepting "Марс" (Mars) as an answer to the question for a planet in our solar system.
The issue seems to consist of two parts – first, the Ukrainian translations of some planet names included periods at the end. I have fixed that on Transifex, see #211.
But also the comparison itself had some problems with multi-byte characters from non-Latin scripts. I have replaced the
strtolowerandstrtoupperfunctions with theirmb_-prefixed versions to ensure they work properly.I also removed aI re-added sanitization for the variable used in the error message when you enter an incorrect answer. I suppose that's what is was meant for.Sanitiser::getTitlecall on the input – since we are only comparing strings and not trusting the input for anything else, sanitization shouldn't be necessary here, and if we run it on the input, we would also have to run it on the accepted responses, so throwing it out altogether was the easier option.