WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 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: solarissmoke

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 4 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 solarissmoke4 years ago

  • Keywords has-patch added

solarissmoke4 years ago

comment:2 scribu4 years ago

  • Milestone changed from Unassigned to 3.0

comment:3 miqrogroove4 years ago

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

Duplicates #11286

comment:4 scribu4 years ago

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