codeigniter4 / CodeIgniter4

Open Source PHP Framework (originally from EllisLab)
https://codeigniter.com/
MIT License
5.37k stars 1.9k forks source link

Bug: Validation rules and #9247

Open ECode16 opened 3 days ago

ECode16 commented 3 days ago

PHP Version

7.4

CodeIgniter4 Version

4.4.8

CodeIgniter4 Installation Method

Composer (using codeigniter4/appstarter)

Which operating systems have you tested for this bug?

Windows

Which server did you use?

cli

Database

Postgres 16

What happened?

All alphabetical/alphanumerical evaluate to false when encountering non-English characters (accented/cyrillic).

Steps to Reproduce

service('validation')->check('пЗХТЕГ', 'alpha'); service('validation')->check('á', 'alpha');

Expected Output

true true

Anything else?

No response

neznaika0 commented 3 days ago

Not bug. Read docs:

Fails if field has anything other than alphabetic characters in ASCII.

Use regex_match[/[а-яё]+/]