mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 00:54:41 +00:00
MVC - IntegerFieldType: fix IntegerValidator returning false for negative numbers (#5837)
This commit is contained in:
parent
6a69e524e0
commit
5cffdd7ef9
@ -50,7 +50,7 @@ class IntegerValidator extends BaseValidator
|
||||
{
|
||||
$value = $validator->getValue($attribute);
|
||||
$msg = $this->getOption('message');
|
||||
if (ctype_digit(strval(($value))) == false or (string)((int)$value) !== (string)$value) {
|
||||
if (filter_var($value, FILTER_VALIDATE_INT) === false) {
|
||||
$validator->appendMessage(new Message($msg, $attribute, 'IntegerValidator'));
|
||||
return false;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user