Skip to content

Commit

Permalink
Fix issue with validation on locales where comma used as decimal point
Browse files Browse the repository at this point in the history
  • Loading branch information
mervick committed Aug 10, 2018
1 parent 2b889c5 commit 0df21c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion phalcon/validation/validator/numericality.zep
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Numericality extends Validator

let value = validation->getValue(field);

if !preg_match("/^-?\d+\.?\d*$/", value) {
if !preg_match("/^-?\d+(?:[\.,]\d+)?$/", value) || !is_numeric(value) {
let label = this->prepareLabel(validation, field),
message = this->prepareMessage(validation, field, "Numericality"),
code = this->prepareCode(field);
Expand Down

0 comments on commit 0df21c8

Please sign in to comment.