Incorrect code is generated when multibyte characters are used

Created on 21 December 2024, 6 months ago

Image Captcha generates incorrect codes when using multibyte characters such as Japanese.

* Example:
- Characters to use in the code: あかさたなは
- Code length: 5
- Generated code: あかさあかさあかさたなはあかさ
- Desirable code: はたかなさ

This issue is caused by issue #3184909, “Fix coding standard for php strlen and substr”.
https://www.drupal.org/project/captcha/issues/3184909

This issue occurs in versions 8.x-1.7 through the latest version 2.0.7.

The code is correct before the patch was applied. Using a multibyte function for single-byte processing logic is incorrect. It is working correctly in version 7.x.

Please revert back to the pre-patch version.

🐛 Bug report
Status

Active

Version

2.0

Component

Image Captcha (image_captcha)

Created by

🇯🇵Japan mula

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024