WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#13028 closed defect (bug) (duplicate)

Make sure a commenter doesn't receive a blank screen when comment is rejected

Reported by: solarissmoke Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Comments Keywords: dev-feedback has-patch
Focuses: Cc:

Description

In the last few changes to wp-comments-post the following action hooks have been added ahead of the pre_comment_on_post action hook:

  • comment_on_trash
  • comment_on_draft
  • comment_on_password_protected

However, none of these hooks have default actions associated with them, which means that on a default install, if someone manages to post a comment on a trashed/draft/protected post, they get a blank screen without any explanation of what went wrong.

I think there should be some default actions here, or some default behaviour in between the action hook and the exit statements.

Proposed patch to follow.

Attachments (1)

default-behaviour-for-disallowed-comments.patch (1.1 KB) - added by solarissmoke 5 years ago.

Download all attachments as: .zip

Change History (4)

comment:1 @solarissmoke5 years ago

xref #11286 for the 403 status header issue. There is no reason WP should return a 500 status error in these cases.

comment:2 @solarissmoke5 years ago

  • Resolution set to duplicate
  • Status changed from new to closed

Whoops, it looks like proposed patch for #11286 addresses these issues, so I'll just pursue this there.

comment:3 @nacin5 years ago

  • Milestone 3.0 deleted
Note: See TracTickets for help on using tickets.