[wp-trac] [WordPress Trac] #37572: When wp-mail.php is disabled, it returns 500 instead of a more appropriate 403 response
WordPress Trac
noreply at wordpress.org
Thu Aug 4 15:15:18 UTC 2016
#37572: When wp-mail.php is disabled, it returns 500 instead of a more appropriate
403 response
--------------------------+-----------------------------
Reporter: tomdxw | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Mail | Version: 4.5.3
Severity: normal | Keywords:
Focuses: |
--------------------------+-----------------------------
To reproduce:
1. Add this to a theme or a plugin:
`add_filter('enable_post_by_email_configuration', function () { return
false; });`
2. Visit `/wp-mail.php`
You will get a 500 Internal Server Error.
500 responses are reserved for an "unexpected condition" and therefore are
monitored closely by sysadmins. Using 500 responses inappropriately wastes
sysadmin time by forcing them to write a rule to ignore 500 responses
coming from `/wp-mail.php`.
A 403 Forbidden status code would be more appropriate as it indicates that
"the request is for something forbidden" which is exactly what the message
says ("This action has been disabled by the administrator.").
--
Ticket URL: <https://core.trac.wordpress.org/ticket/37572>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list