mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-06 23:39:02 +01:00
Fixes #16903: Fixed 'yii\validators\NumberValidator' method 'isNotNumber' returns false for true/false value
This commit is contained in:
committed by
Alexander Makarov
parent
3907895324
commit
d7ffda020b
@@ -124,8 +124,9 @@ class NumberValidator extends Validator
|
||||
private function isNotNumber($value)
|
||||
{
|
||||
return is_array($value)
|
||||
|| (is_object($value) && !method_exists($value, '__toString'))
|
||||
|| (!is_object($value) && !is_scalar($value) && $value !== null);
|
||||
|| is_bool($value)
|
||||
|| (is_object($value) && !method_exists($value, '__toString'))
|
||||
|| (!is_object($value) && !is_scalar($value) && $value !== null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user