mirror of
https://github.com/silverstripe/silverstripe-mathspamprotection
synced 2024-09-27 11:05:55 +02:00
Merge pull request #1 from marijnkampf/master
BUGFIX: Fixed validation for mathspamprotection. MINOR: added dutch translation.
This commit is contained in:
commit
7d1a277815
@ -47,7 +47,8 @@ class MathSpamProtectorField extends SpamProtectorField {
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
@ -55,6 +56,15 @@ class MathSpamProtectorField extends SpamProtectorField {
|
||||
if(!self::is_enabled()) return true;
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -2,26 +2,27 @@
|
||||
|
||||
global $lang;
|
||||
|
||||
$lang['en_US']['MathSpamProtection']['EIGHT'] = 'eight';
|
||||
$lang['en_US']['MathSpamProtection']['EIGHTEEN'] = 'eighteen';
|
||||
$lang['en_US']['MathSpamProtection']['ELEVEN'] = 'eleven';
|
||||
$lang['en_US']['MathSpamProtection']['FIFTEEN'] = 'fifteen';
|
||||
$lang['en_US']['MathSpamProtection']['FIVE'] = 'five';
|
||||
$lang['en_US']['MathSpamProtection']['FOUR'] = 'four';
|
||||
$lang['en_US']['MathSpamProtection']['FOURTEEN'] = 'fourteen';
|
||||
$lang['en_US']['MathSpamProtection']['NINE'] = 'nine';
|
||||
$lang['en_US']['MathSpamProtection']['ONE'] = 'one';
|
||||
$lang['en_US']['MathSpamProtection']['SEVEN'] = 'seven';
|
||||
$lang['en_US']['MathSpamProtection']['SEVENTEEN'] = 'seventeen';
|
||||
$lang['en_US']['MathSpamProtection']['SIX'] = 'six';
|
||||
$lang['en_US']['MathSpamProtection']['SIXTEEN'] = 'sixteen';
|
||||
$lang['en_US']['MathSpamProtection']['TEN'] = 'ten';
|
||||
$lang['en_US']['MathSpamProtection']['THIRTEEN'] = 'thirteen';
|
||||
$lang['en_US']['MathSpamProtection']['THREE'] = 'three';
|
||||
$lang['en_US']['MathSpamProtection']['TWELVE'] = 'twelve';
|
||||
$lang['en_US']['MathSpamProtection']['TWO'] = 'two';
|
||||
$lang['en_US']['MathSpamProtection']['WHATIS'] = 'What is %s plus %s?';
|
||||
$lang['en_US']['MathSpamProtection']['ZERO'] = 'zero';
|
||||
$lang['en_US']['MathSpamProtection']['ONE'] = 'one';
|
||||
$lang['en_US']['MathSpamProtection']['TWO'] = 'two';
|
||||
$lang['en_US']['MathSpamProtection']['THREE'] = 'three';
|
||||
$lang['en_US']['MathSpamProtection']['FOUR'] = 'four';
|
||||
$lang['en_US']['MathSpamProtection']['FIVE'] = 'five';
|
||||
$lang['en_US']['MathSpamProtection']['SIX'] = 'six';
|
||||
$lang['en_US']['MathSpamProtection']['SEVEN'] = 'seven';
|
||||
$lang['en_US']['MathSpamProtection']['EIGHT'] = 'eight';
|
||||
$lang['en_US']['MathSpamProtection']['NINE'] = 'nine';
|
||||
$lang['en_US']['MathSpamProtection']['TEN'] = 'ten';
|
||||
$lang['en_US']['MathSpamProtection']['ELEVEN'] = 'eleven';
|
||||
$lang['en_US']['MathSpamProtection']['TWELVE'] = 'twelve';
|
||||
$lang['en_US']['MathSpamProtection']['THIRTEEN'] = 'thirteen';
|
||||
$lang['en_US']['MathSpamProtection']['FOURTEEN'] = 'fourteen';
|
||||
$lang['en_US']['MathSpamProtection']['FIFTEEN'] = 'fifteen';
|
||||
$lang['en_US']['MathSpamProtection']['SIXTEEN'] = 'sixteen';
|
||||
$lang['en_US']['MathSpamProtection']['SEVENTEEN'] = 'seventeen';
|
||||
$lang['en_US']['MathSpamProtection']['EIGHTEEN'] = 'eighteen';
|
||||
$lang['en_US']['MathSpamProtection']['WHATIS'] = 'What is %s plus %s?';
|
||||
$lang['en_US']['MathSpamProtectionField']['SPAMQUESTION'] = 'Spam protection question: %s';
|
||||
$lang['en_US']['MathSpamProtectionField']['INCORRECTSOLUTION'] = 'Incorrect solution to the spam protection question, please try again.';
|
||||
|
||||
?>
|
28
lang/nl_NL.php
Normal file
28
lang/nl_NL.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
global $lang;
|
||||
|
||||
$lang['en_US']['MathSpamProtection']['ZERO'] = 'nul';
|
||||
$lang['en_US']['MathSpamProtection']['ONE'] = 'een';
|
||||
$lang['en_US']['MathSpamProtection']['TWO'] = 'twee';
|
||||
$lang['en_US']['MathSpamProtection']['THREE'] = 'drie';
|
||||
$lang['en_US']['MathSpamProtection']['FOUR'] = 'vier';
|
||||
$lang['en_US']['MathSpamProtection']['FIVE'] = 'vijf';
|
||||
$lang['en_US']['MathSpamProtection']['SIX'] = 'zes';
|
||||
$lang['en_US']['MathSpamProtection']['SEVEN'] = 'zeven';
|
||||
$lang['en_US']['MathSpamProtection']['EIGHT'] = 'acht';
|
||||
$lang['en_US']['MathSpamProtection']['NINE'] = 'negen';
|
||||
$lang['en_US']['MathSpamProtection']['TEN'] = 'tien';
|
||||
$lang['en_US']['MathSpamProtection']['ELEVEN'] = 'elf';
|
||||
$lang['en_US']['MathSpamProtection']['TWELVE'] = 'twaalf';
|
||||
$lang['en_US']['MathSpamProtection']['THIRTEEN'] = 'dertien';
|
||||
$lang['en_US']['MathSpamProtection']['FOURTEEN'] = 'veertien';
|
||||
$lang['en_US']['MathSpamProtection']['FIFTEEN'] = 'vijftien';
|
||||
$lang['en_US']['MathSpamProtection']['SIXTEEN'] = 'zestien';
|
||||
$lang['en_US']['MathSpamProtection']['SEVENTEEN'] = 'zeventien';
|
||||
$lang['en_US']['MathSpamProtection']['EIGHTEEN'] = 'achttien';
|
||||
$lang['en_US']['MathSpamProtection']['WHATIS'] = 'Hoeveel is %s plus %s?';
|
||||
$lang['en_US']['MathSpamProtectionField']['SPAMQUESTION'] = 'Anti-spam vraag: %s';
|
||||
$lang['en_US']['MathSpamProtectionField']['INCORRECTSOLUTION'] = 'Onjuist antwoord op de anti-spam vraag, probeer opnieuw.';
|
||||
|
||||
?>
|
Loading…
Reference in New Issue
Block a user