WordPress.org

Make WordPress Core

Opened 12 months ago

Closed 9 months ago

#51493 closed defect (bug) (fixed)

Type error in wp_xmlrpc_server::_prepare_taxonomy()

Reported by: johnbillion Owned by: johnbillion
Milestone: 5.7 Priority: normal
Severity: normal Version: 3.7
Component: XML-RPC Keywords: needs-patch good-first-bug needs-unit-tests
Focuses: Cc:

Description (last modified by SergeyBiryukov)

There's a type error in the wp_xmlrpc_server::_prepare_taxonomy() method.

Ref: https://core.trac.wordpress.org/browser/tags/5.5.1/src/wp-includes/class-wp-xmlrpc-server.php?marks=768-770#L742

If $fields array contains a menu element then it tries to read the show_in_menu property from $_taxonomy, but this is an array not an object.

Probably just needs $_taxonomy changed to $taxonomy but needs testing, ideally needs a unit test and steps to reproduce.

Introduced in [25133] / #20930.

Change History (3)

#1 @SergeyBiryukov
10 months ago

  • Description modified (diff)

#2 @johnbillion
9 months ago

  • Milestone changed from Awaiting Review to 5.7

#3 @johnbillion
9 months ago

  • Owner set to johnbillion
  • Resolution set to fixed
  • Status changed from new to closed

In 49856:

XML-RPC: Fix a type error when requesting the menu field of a taxonomy.

Fixes #51493

Note: See TracTickets for help on using tickets.