WordPress.org

Make WordPress Core

Opened 5 months ago

Last modified 3 months ago

#47188 new defect (bug)

Ensure that valid json is return for rest api, even when correct headers not sent.

Reported by: spacedmonkey Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.4
Component: Site Health Keywords: servehappy has-patch
Focuses: rest-api Cc:

Description

Current when wp_die is called in php fatal error handler, valid json is only returned when json headers are returned as the function wp_is_json_request is used. See #45933.

However, core could do more to return json when it knows the current request is a REST API call.

Attachments (1)

47188.diff (1.2 KB) - added by spacedmonkey 5 months ago.

Download all attachments as: .zip

Change History (6)

#1 @spacedmonkey
5 months ago

  • Keywords needs-patch added; has-patch removed

Related: #34999

@spacedmonkey
5 months ago

#2 @spacedmonkey
5 months ago

  • Keywords has-patch added; needs-patch removed

First patch 47188.diff to kick discussion.

This ticket was mentioned in Slack in #core-php by spacedmonkey. View the logs.


3 months ago

This ticket was mentioned in Slack in #core-php by afragen. View the logs.


3 months ago

#5 @spacedmonkey
3 months ago

  • Component changed from REST API to Site Health
Note: See TracTickets for help on using tickets.