Skip to content
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

Uppercase and lowercase are treated as the same thing #65

Open
AnnoyingTechnology opened this issue Sep 25, 2018 · 7 comments
Open

Uppercase and lowercase are treated as the same thing #65

AnnoyingTechnology opened this issue Sep 25, 2018 · 7 comments

Comments

@AnnoyingTechnology
Copy link

AnnoyingTechnology commented Sep 25, 2018

When a picture generated uses uppercase letters, ->getPhrase() returns a lowercase phrase.

@MaksNovalis
Copy link

Had the same issue.
The Problem is the font: "captcha2.ttf". I removed it (rearranged the random number) and the captcha doesn't show any uppercase letters again.

@AnnoyingTechnology
Copy link
Author

@MaksNovalis Would you mind offering a pull request with your changes so that other can benefit from it ?

@Cacodaimon
Copy link

@Gregwar A fix for this would be nice!

@Gregwar
Copy link
Owner

Gregwar commented Aug 28, 2019

Hello,
Actually no uppercase letters are generated in first place, maybe the confusion is related to the fonts or the appearance of image

However, I suggest you to use case insensitive comparsions, and as well offer some tolerance for 0 vs O and 1 vs l

I added an helper PhraseBuilder::comparePhrases() to do that, and updated the example in demo/form.php

@Cacodaimon
Copy link

Hi @Gregwar,

Actually no uppercase letters are generated in first place, maybe the confusion is related to the fonts or the appearance of image

The font captcha2.ttf contains only upper case letters, this is the reason that some captchas gets displayed in upper case letters.

This is a screenshot of the captcha2.ttf where you can see that the lower case letters are upper case:
Screenshot_2019-08-29_10-36-16

Just another font as comparison:
Screenshot_2019-08-29_10-36-36

I added an helper PhraseBuilder::comparePhrases() to do that, and updated the example in demo/form.php

This helper is cool and I will use it, but we tell out user that all letters in the captcha are in lowercase therefore some captcha, displayed in upper case, lead to confusion.

@Gregwar
Copy link
Owner

Gregwar commented Aug 30, 2019

Maybe we should replace that font as well so it would be more clear

@gitator
Copy link

gitator commented Oct 29, 2021

Maybe we should replace that font as well so it would be more clear

yes, it's causing confusion when trying to hit correct phrase sometimes...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants