mirror of
https://github.com/silverstripe/silverstripe-mathspamprotection
synced 2024-10-22 08:05:52 +02:00
Inserted missing validator notify callback object
This commit is contained in:
parent
dcccf5dd91
commit
0d88c9da19
@ -47,7 +47,8 @@ class MathSpamProtectorField extends SpamProtectorField {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates the value submitted by the user with the one saved
|
* Validates the value submitted by the user with the one saved
|
||||||
* into the {@link Session}
|
* into the {@link Session} and then notify callback object
|
||||||
|
* with the spam checking result.
|
||||||
*
|
*
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
@ -55,6 +56,15 @@ class MathSpamProtectorField extends SpamProtectorField {
|
|||||||
if(!self::is_enabled()) return true;
|
if(!self::is_enabled()) return true;
|
||||||
|
|
||||||
if(!self::correct_answer($this->Value())){
|
if(!self::correct_answer($this->Value())){
|
||||||
|
$validator->validationError(
|
||||||
|
$this->name,
|
||||||
|
_t(
|
||||||
|
'MathSpamProtectionField.INCORRECTSOLUTION',
|
||||||
|
"Incorrect solution to the spam protection question, please try again.",
|
||||||
|
PR_MEDIUM
|
||||||
|
),
|
||||||
|
"error"
|
||||||
|
);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user