older php version did not coerce string -> int

got some problems with older PHP versions, this change is a little bit on the lazy side but will do the work. 

https://stackoverflow.com/questions/8529656/how-do-i-convert-a-string-to-a-number-in-php
https://www.php.net/manual/en/language.types.type-juggling.php#language.types.typecasting
This commit is contained in:
Tech-Maou 2021-04-05 20:28:57 +02:00 committed by GitHub
parent 5dbb469c4c
commit e4710c0269
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -157,7 +157,7 @@ class MathSpamProtectorField extends TextField
$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) === (int)$answer)));
}
/**