WordPress.org

Make WordPress Core

Opened 8 months ago

Closed 8 months ago

Last modified 8 months ago

#52947 closed defect (bug) (reported-upstream)

Docs: json_decode PHP function is inadvertently pulled up in DevHub documentation

Reported by: audrasjb Owned by:
Milestone: WordPress.org Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: docs Cc:

Description (last modified by audrasjb)

I don't know exactly why, but it seems like the json_decode native PHP function is inadvertently pulled up in DevHub Documentation.

https://developer.wordpress.org/reference/functions/json_decode/

Interestingly, the related source code seems to be the hash_equals function.

Here is the linked source on Trac: https://core.trac.wordpress.org/browser/tags/5.7/src/wp-includes/compat.php#L304

Change History (5)

#1 @audrasjb
8 months ago

Props @crstauf who raised this in DevHub user notes.

#2 @audrasjb
8 months ago

  • Description modified (diff)

#3 @coffee2code
8 months ago

  • Milestone Awaiting Review deleted
  • Resolution set to reported-upstream
  • Status changed from new to closed

Core included a polyfill for json_decode() (and a few other functions) until [46208]. See #47699 for the ticket related to its removal.

The PHPDOC parser plugin used by DevHub does not currently handle the complete removal of a function from the source being parsed, so such functions (as the one referenced here) get orphaned.

I've removed the following polyfills that had been removed in [46208]:

  • json_encode()
  • json_decode()
  • _json_decode_object_helper()
  • json_last_error_msg()

Closing as reported-upstream since this is really a problem for meta.trac (though I've taken care of it here).

#4 @SergeyBiryukov
8 months ago

  • Milestone set to WordPress.org

#5 @audrasjb
8 months ago

  • Keywords needs-patch removed

Thanks @coffee2code!

Note: See TracTickets for help on using tickets.