-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[BUG] Numericality validator does not work in some locales #13450
Labels
Comments
Proposal It can be fixed if this line
change to this if !preg_match("/^-?\d+[\.,]?\d*$/", value) || !is_numeric(value) { |
This would be an issue with other locales as well. I think EU uses comma seperated minor as well. |
@JABirchall, @mervick Could you please send a PR to the 3.4.x branch? |
mervick
added a commit
to mervick/cphalcon
that referenced
this issue
Aug 2, 2018
3 tasks
mervick
added a commit
to mervick/cphalcon
that referenced
this issue
Aug 10, 2018
mervick
added a commit
to mervick/cphalcon
that referenced
this issue
Aug 10, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected and Actual Behavior
Numericality validator returns validation error 'Field :field does not have a valid numeric format' for valid float number when php uses locales which uses coma
,
in locality number format, for exampleru_RU.utf8
localeThe main problem is that Numericality validator uses regexp:
cphalcon/phalcon/validation/validator/numericality.zep
Line 74 in adfcef5
Code below perfectly demonstrates this bug
(make sure that you installed both
en_US.utf8
andru_RU.utf8
locales in your system)Output:
Details
The text was updated successfully, but these errors were encountered: