Skip to content

Commit

Permalink
Merge pull request #125 from tractorcow/pulls/2.0/fix-spam-redirection
Browse files Browse the repository at this point in the history
BUG Fix redirection on moderated & spam comments
  • Loading branch information
assertchris committed May 28, 2015
2 parents 74c14a8 + 2aa8d97 commit bc8f2c1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions code/controllers/CommentingController.php
Expand Up @@ -566,13 +566,13 @@ public function doPostComment($data, $form) {
}

// 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
$holder = $this->getOption('comments_holder_id');
$hash = "{$holder}_PostCommentForm_error";
} elseif($comment->IsSpam) {
// Link to the form with the error message contained
$hash = $form->FormName();
} else {
// Link to the moderated, non-spam comment
$hash = $comment->Permalink();
Expand Down

0 comments on commit bc8f2c1

Please sign in to comment.