mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Changed spam protection so that user is redirected back to comment form if they get the question wrong and don't use javascript.
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@39735 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
d521b06a8c
commit
3a805afecf
@ -120,7 +120,11 @@ class PageCommentInterface_Form extends Form {
|
||||
//check if spam question was right.
|
||||
if(MathSpamProtection::isEnabled()){
|
||||
if(!MathSpamProtection::correctAnswer($data['Math'])){
|
||||
echo "<div class='BlogError'><p>You got the spam protection question wrong.</p></div>";
|
||||
if(Director::is_ajax()) {
|
||||
echo "<div class='BlogError'><p>You got the spam protection question wrong.</p></div>";
|
||||
} else {
|
||||
Director::redirectBack();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user