Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#41759 closed enhancement (fixed)

WP_HTTP_Response: Use setter instead of directly accessing the $data property

Reported by: tfrommen Owned by: SergeyBiryukov
Priority: normal Milestone: 4.9
Component: HTTP API Version: 4.4
Severity: normal Keywords: has-patch commit
Cc: Focuses: rest-api

Description

The constructor of the WP_HTTP_Response class (and thus also WP_REST_Response) has three arguments: $data, $status and $headers.

While there is a dedicated setter for each of the three properties, $data is set directly.

In order to enable people to rely on inheritane and automatically use overwritten methods, let's use the setter, please.

Patch will follow soonish.

Attachments (1)

41759.patch​ (641 bytes ) - added by tfrommen 9 years ago.

Download all attachments as: .zip

Change History (7)

#1 @tfrommen
9 years ago

  • Keywords has-patch added

#2 @rmccue
9 years ago

  • Focuses rest-api added
  • Keywords commit added
  • Milestone Awaiting Review → 4.9
  • Version → 4.4

This ticket was mentioned in ​Slack in #core by jeffpaul. ​View the logs.


9 years ago

This ticket was mentioned in ​Slack in #core by jeffpaul. ​View the logs.


9 years ago

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


9 years ago

#6 @SergeyBiryukov
9 years ago

  • Owner set to SergeyBiryukov
  • Resolution → fixed
  • Status new → closed

In 41707:

HTTP API: Use WP_HTTP_Response::set_data() in ::__construct() instead of directly accessing the $data property.

Props tfrommen.
Fixes #41759.

Note: See TracTickets for help on using tickets.