Skip to content

Commit

Permalink
Fix validateDecimal() (laravel#46809)
Browse files Browse the repository at this point in the history
  • Loading branch information
apih committed Apr 17, 2023
1 parent 88c28e2 commit a56d748
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Illuminate/Validation/Concerns/ValidatesAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -585,12 +585,12 @@ public function validateDateEquals($attribute, $value, $parameters)
*/
public function validateDecimal($attribute, $value, $parameters)
{
$this->requireParameterCount(1, $parameters, 'decimal');

if (! $this->validateNumeric($attribute, $value)) {
return false;
}

$this->requireParameterCount(1, $parameters, 'decimal');

$matches = [];

preg_match('/^[+-]?\d*.(\d*)$/', $value, $matches);
Expand Down

0 comments on commit a56d748

Please sign in to comment.