This commit is contained in:
as2252258@163.com
2021-04-07 01:53:32 +08:00
parent c3617e89d5
commit ed6cb4cf28
4 changed files with 580 additions and 627 deletions
+3 -3
View File
@@ -60,7 +60,7 @@ class LengthValidator extends BaseValidator
return $this->addError('The param :attribute length overflow');
}
} else {
if (is_numeric($value) && strlen(floatval($value)) > $this->value) {
if (is_numeric($value) && strlen((string)$value) > $this->value) {
return $this->addError('The param :attribute length overflow');
}
if (strlen($value) > $this->value) {
@@ -83,7 +83,7 @@ class LengthValidator extends BaseValidator
return $this->addError('The param :attribute length error');
}
} else {
if (is_numeric($value) && strlen(floatval($value)) < $this->value) {
if (is_numeric($value) && strlen((string)$value) < $this->value) {
return $this->addError('The param :attribute length overflow');
}
if (strlen($value) < $this->value) {
@@ -106,7 +106,7 @@ class LengthValidator extends BaseValidator
return $this->addError('The param :attribute length error');
}
} else {
if (is_numeric($value) && mb_strlen(floatval($value)) !== $this->value) {
if (is_numeric($value) && strlen((string)$value) !== $this->value) {
return $this->addError('The param :attribute length overflow');
}
if (mb_strlen($value) !== $this->value) {