framework icon indicating copy to clipboard operation
framework copied to clipboard

Alpha validation rules allow non alpha characters

Open doshu opened this issue 3 years ago • 0 comments

  • Laravel Version: 9.x
  • PHP Version: 7.x - 8.x

Validation rule alpha, use a wrong unicode char property that allow non alpha character to pass the validation. The used regex use the \pM unicode property, that allow every chars in the group "Marks"

Some chars like ⃞ or ҈ are allowed by the regular expression but they should not.

step to reproduce:

var_dump(preg_match('/^[\pL\pM]+$/u', "\u{0488}"));

doshu avatar Aug 09 '22 16:08 doshu

I'm not sure about those characters sorry. If you want, you can send in a PR with a test in testValidateAlpha.

driesvints avatar Aug 11 '22 07:08 driesvints