Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#52524 closed defect (bug) (fixed)

Add extra context to the `xmlrpc_call` action

Reported by: dd32's profile dd32 Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.7 Priority: normal
Severity: normal Version:
Component: XML-RPC Keywords: has-patch
Focuses: Cc:

Description

The xmlrpc_call action currently passes the method name to the action, but fails to pass the arguments presented. That can make the action hard to use when the call passes specific content in the payload of the request.

For example, when the wp.getRevisions XML-RPC call is made, it's impossible to tell what post is being accessed via the API for dynamic filtering without reaching into the internals of the global $wp_xmlrpc_server object.

The attached PR simply adds the $args parameter to the action call along with the RPC server for consistency sake.

Change History (8)

This ticket was mentioned in PR #1004 on WordPress/wordpress-develop by dd32.


4 years ago
#1

  • Keywords has-patch added

#2 @SergeyBiryukov
4 years ago

  • Milestone changed from Awaiting Review to 5.7
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#3 @SergeyBiryukov
4 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 50353:

XML-RPC: Pass the method arguments and the XML-RPC server instance to the xmlrpc_call action.

This provides better context and makes the action easier to use when the call passes specific content in the payload of the request.

Props dd32.
Fixes #52524.

#6 @dd32
4 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Re-opening for PR 1073 above, my PR incorrectly used $args for two methods which have no args. This patch simply replaces it with an empty array.

Fixes the following PHP Notices:

E_NOTICE: Undefined variable: args in wp-includes/class-wp-xmlrpc-server.php:6652
E_NOTICE: Undefined variable: args in wp-includes/class-wp-xmlrpc-server.php:6664

#7 @SergeyBiryukov
4 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 50499:

XML-RPC: Pass an empty array to the xmlrpc_call action in methods that have no arguments.

This avoids an "Undefined variable" PHP notice in the ::mt_supportedMethods() and ::mt_supportedTextFilters() methods.

Follow-up to [50353].

Props dd32.
Fixes #52524.

#8 @SergeyBiryukov
4 years ago

In 50500:

XML-RPC: Pass an empty array to the xmlrpc_call action in methods that have no arguments.

This avoids an "Undefined variable" PHP notice in the ::mt_supportedMethods() and ::mt_supportedTextFilters() methods.

Follow-up to [50353].

Props dd32.
Reviewed by dd32, SergeyBiryukov.
Merges [50499] to the 5.7 branch.
Fixes #52524.

Note: See TracTickets for help on using tickets.