diff --git a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php index 9a4ca19b5431..5b59302112bc 100644 --- a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php +++ b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php @@ -581,7 +581,7 @@ public function validateDigitsBetween($attribute, $value, $parameters) $length = strlen((string) $value); - return ! preg_match('/[^0-9.]/', $value) + return ! preg_match('/[^0-9]/', $value) && $length >= $parameters[0] && $length <= $parameters[1]; } diff --git a/tests/Validation/ValidationValidatorTest.php b/tests/Validation/ValidationValidatorTest.php index 08e292d85310..e2fddc7d4e62 100755 --- a/tests/Validation/ValidationValidatorTest.php +++ b/tests/Validation/ValidationValidatorTest.php @@ -2337,12 +2337,6 @@ public function testValidateDigits() $v = new Validator($trans, ['foo' => '+12.3'], ['foo' => 'digits_between:1,6']); $this->assertFalse($v->passes()); - - $v = new Validator($trans, ['foo' => '1.2'], ['foo' => 'digits_between:1,10']); - $this->assertTrue($v->passes()); - - $v = new Validator($trans, ['foo' => '0.9876'], ['foo' => 'digits_between:1,5']); - $this->assertTrue($v->fails()); } public function testValidateSize()