Make WordPress Core

Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#11333 closed defect (bug) (duplicate)

wp-comments-post shouldn't return a 500 error for user errors

Reported by: solarissmoke's profile solarissmoke Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Comments Keywords: has-patch
Focuses: Cc:


This has been discussed also in, but wasn't addressed, so sorry to dredge it up again, but I think it is a valid point.

When a user submits a duplicate comment, or enters a comment field incorrectly, or comments are closed/restricted, wp-comments-post uses wp_die() to inform them of the error. By default wp_die returns a 500 Internal Sever Error.

However for these cases it isn't a server error, it is a client error. So the response code should be anything but 500. Maybe 403? Or if that isn't liked, then just 200. If there isn't agreement on what the response should be then at least a filter should exist to let the owner choose.

Attached is a proposed change to return a 403 instead of 500.

Attachments (1)

11333.diff (2.3 KB) - added by solarissmoke 14 years ago.

Download all attachments as: .zip

Change History (5)

#1 @solarissmoke
14 years ago

  • Keywords has-patch added

14 years ago

#2 @scribu
14 years ago

  • Milestone changed from Unassigned to 3.0

#3 @miqrogroove
14 years ago

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

Duplicates #11286

#4 @scribu
14 years ago

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