-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
fix: validation change behavior regex match in integer
and numeric
to php function
#6490
Conversation
integer
and numeric
to php function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add tests.
{ | ||
return (bool) preg_match('/\A[\-+]?\d+\z/', $str ?? ''); | ||
return is_int($str); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All data sent via HTTP is represented as strings and arrays. That is, an integer as a string will not pass validation.
I think that it would be more correct to remove typehint for passed values in all rules. Casting to the appropriate types within the method. |
This PR brings a lot of breaking changes. Probably unacceptable.
|
Yes. When we introduce |
@kenjis this PR stuck on cache test php unit, i already adjusted in |
Description
Fixed #6489
Checklist: