Skip to content

Commit

Permalink
Merge pull request #54 from Juanitou/pr
Browse files Browse the repository at this point in the history
Actually enforce strict numeric comparison for answer
  • Loading branch information
wilr authored Oct 6, 2021
2 parents 5dbb469 + 3615453 commit 68ad231
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/MathSpamProtectorField.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function isCorrectAnswer($answer)

$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))));
}

/**
Expand Down

0 comments on commit 68ad231

Please sign in to comment.