Captcha icon indicating copy to clipboard operation
Captcha copied to clipboard

Uppercase and lowercase are treated as the same thing

Open AnnoyingTechnology opened this issue 6 years ago • 7 comments

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

AnnoyingTechnology avatar Sep 25 '18 12:09 AnnoyingTechnology

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.

MaksNovalis avatar Oct 25 '18 15:10 MaksNovalis

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

AnnoyingTechnology avatar Oct 31 '18 14:10 AnnoyingTechnology

@Gregwar A fix for this would be nice!

Cacodaimon avatar Aug 08 '19 10:08 Cacodaimon

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

Gregwar avatar Aug 28 '19 13:08 Gregwar

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.

Cacodaimon avatar Aug 29 '19 09:08 Cacodaimon

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

Gregwar avatar Aug 30 '19 08:08 Gregwar

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...

gitator avatar Oct 29 '21 13:10 gitator