Make WordPress Core

Opened 5 years ago

Closed 2 years ago

#37856 closed defect (bug) (wontfix)

Prepare data before sanity check in wp_json_encode()

Reported by: swissspidy Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.6
Component: General Keywords: has-patch dev-feedback
Focuses: Cc:


Splitting this out of #37731 as a followup to #36358.

In wp_json_encode(), the data is being prepared for JSON sanitization for _wp_json_prepare_data(). Later on, the call to _wp_json_sanity_check() doesn't use the prepared data but the raw data instead.

I don't see why this was done that way in #36358, so I'd love to hear what @rmccue has to say about it.

Attachments (1)

37856.diff (1.1 KB) - added by swissspidy 5 years ago.
Props ionutst

Download all attachments as: .zip

Change History (6)

5 years ago

Props ionutst

#1 @swissspidy
5 years ago

  • Keywords has-patch added

#2 @desrosj
2 years ago

  • Keywords dev-feedback added
  • Milestone changed from Awaiting Review to Future Release

I don't see why this was done that way in #36358

@rmccue @rachelbaker @jrf (other participants in #36258) Do you recall any context for this?

#3 @jrf
2 years ago

@desrosj That's basically the exact same question I asked in #36358 and why that ticket had three potential patches as it wasn't clear at all what the intention was.

@rmccue created the original code and decided it should be patch 1, so I can only defer to his judgement.

#4 @jrf
2 years ago

Related #47699 - As WP 5.6 is the minimum WP version now, the _wp_json_prepare_data() is slated for deprecation as it was only needed to provide cross-version support for PHP 5.2-5.3.

With that in mind, can this ticket be closed ?

#5 @swissspidy
2 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Sounds good to me! Closing in favor of #47699.

Note: See TracTickets for help on using tickets.