fix: normalize captcha display text to lowercase when case_sensitive is false#2
Merged
Merged
Conversation
…e is false Agent-Logs-Url: https://github.com/DevWizardHQ/wiz-captcha/sessions/4150170b-0026-45ed-b0db-84c50406ca14 Co-authored-by: shazeedul <85868041+shazeedul@users.noreply.github.com>
…ter set Agent-Logs-Url: https://github.com/DevWizardHQ/wiz-captcha/sessions/4150170b-0026-45ed-b0db-84c50406ca14 Co-authored-by: shazeedul <85868041+shazeedul@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
shazeedul
May 10, 2026 05:21
View session
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.
When
case_sensitive = false(the default), the captcha image could render mixed-case text likeAbCdEfwhile silently acceptingABCDEF— technically correct but visually misleading, since the image implies a specific casing that isn't enforced.Changes
TextGenerator::generate()— setsquestion(rendered in image) tomb_strtolower($text)whencaseSensitiveisfalse;answerremains the original text and flows through the existingnormalize()path unchangedCaptchaGenerationTest— adds coverage for:case_sensitive = falsecase_sensitive = true(uses a fixed all-uppercase character pool to avoid flakiness)