Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
tontonsb authored Oct 26, 2020
1 parent 3f0645c commit 48b11cd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Illuminate/Validation/Concerns/ValidatesAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -1267,7 +1267,12 @@ public function validateMultipleOf($attribute, $value, $parameters)
return false;
}

return fmod($value, $parameters[0]) === 0.0;
// We know it's not a multiple of 0 without even attempting to divide by zero.
if ((float) $parameters[0] === 0.0) {
return false;
}

return bcmod($value, $parameters[0], 16) === '0.0000000000000000';
}

/**
Expand Down

0 comments on commit 48b11cd

Please sign in to comment.