Merge pull request #1 from marijnkampf/master

BUGFIX: Fixed validation for mathspamprotection. MINOR: added dutch translation.
This commit is contained in:
Will Rossiter 2011-06-09 14:03:54 -07:00
commit 7d1a277815
3 changed files with 81 additions and 42 deletions

View File

@ -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;
}

View File

@ -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
View 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.';
?>