mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
Merge pull request #125 from tractorcow/pulls/2.0/fix-spam-redirection
BUG Fix redirection on moderated & spam comments
This commit is contained in:
commit
bc8f2c1ad7
@ -566,13 +566,13 @@ class CommentingController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Given a redirect page exists, attempt to link to the correct anchor
|
// Given a redirect page exists, attempt to link to the correct anchor
|
||||||
if(!$comment->Moderated) {
|
if($comment->IsSpam) {
|
||||||
|
// Link to the form with the error message contained
|
||||||
|
$hash = $form->FormName();
|
||||||
|
} else if(!$comment->Moderated) {
|
||||||
// Display the "awaiting moderation" text
|
// Display the "awaiting moderation" text
|
||||||
$holder = $this->getOption('comments_holder_id');
|
$holder = $this->getOption('comments_holder_id');
|
||||||
$hash = "{$holder}_PostCommentForm_error";
|
$hash = "{$holder}_PostCommentForm_error";
|
||||||
} elseif($comment->IsSpam) {
|
|
||||||
// Link to the form with the error message contained
|
|
||||||
$hash = $form->FormName();
|
|
||||||
} else {
|
} else {
|
||||||
// Link to the moderated, non-spam comment
|
// Link to the moderated, non-spam comment
|
||||||
$hash = $comment->Permalink();
|
$hash = $comment->Permalink();
|
||||||
|
Loading…
Reference in New Issue
Block a user