Make WordPress Core

Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#11333 closed defect (bug) (duplicate)

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

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

Description

This has been discussed also in ​http://core.trac.wordpress.org/ticket/7890, 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 17 years ago.

Download all attachments as: .zip

Change History (5)

#1 @solarissmoke
17 years ago

  • Keywords has-patch added

@solarissmoke
17 years ago

#2 @scribu
17 years ago

  • Milestone Unassigned → 3.0

#3 @miqrogroove
17 years ago

  • Resolution → duplicate
  • Status new → closed

Duplicates #11286

#4 @scribu
17 years ago

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