Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#51493 closed defect (bug) (fixed)

Type error in wp_xmlrpc_server::_prepare_taxonomy()

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

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
6 years ago

  • Description modified (diff)

#2 @johnbillion
6 years ago

  • Milestone Awaiting Review5.7

#3 @johnbillion
6 years ago

  • Owner set to johnbillion
  • Resolutionfixed
  • Status newclosed

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.