Actually enforce strict numeric comparison for answer

This commit is contained in:
Juanitou 2021-10-06 16:09:42 +02:00
parent 5dbb469c4c
commit 3615453cdc

View File

@ -157,7 +157,7 @@ class MathSpamProtectorField extends TextField
$word = MathSpamProtectorField::digit_to_word($v1 + $v2); $word = MathSpamProtectorField::digit_to_word($v1 + $v2);
return ($word == strtolower($answer) || ($this->config()->get('allow_numeric_answer') && (($v1 + $v2) === $answer))); return ($word == strtolower($answer) || ($this->config()->get('allow_numeric_answer') && (($v1 + $v2) === intval($answer))));
} }
/** /**