Fix step validation of number field
Will allow validation of number fields with step that's not an integer. HTML5 fields allow steps to be float numbers.pull/86/head
parent
196888bf3e
commit
3b282f3903
|
@ -3754,7 +3754,7 @@ class H5PContentValidator {
|
|||
// Check if number is within allowed bounds even if step value is set.
|
||||
if (isset($semantics->step)) {
|
||||
$testNumber = $number - (isset($semantics->min) ? $semantics->min : 0);
|
||||
$rest = $testNumber % $semantics->step;
|
||||
$rest = fmod($testNumber, $semantics->step);
|
||||
if ($rest !== 0) {
|
||||
$number -= $rest;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue