WordPress.org

Make WordPress Core

Opened 7 months ago

Last modified 4 weeks 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: REST API Keywords: servehappy has-patch
Focuses: rest-api Cc:
PR Number:

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 7 months ago.

Download all attachments as: .zip

Change History (8)

#1 @spacedmonkey
7 months ago

  • Keywords needs-patch added; has-patch removed

Related: #34999

@spacedmonkey
7 months ago

#2 @spacedmonkey
7 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.


6 months ago

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


6 months ago

#5 @spacedmonkey
6 months ago

  • Component changed from REST API to Site Health

#6 @spacedmonkey
4 weeks ago

  • Component changed from Site Health to REST API

Changing to REST API focus, as this makes more sense.

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


4 weeks ago

Note: See TracTickets for help on using tickets.