Make WordPress Core

Changeset 54468

Timestamp:
10/11/2022 01:44:09 AM (22 months ago)
Author:
desrosj
Message:

XML-RPC: Avoid loopback request in blogger.getUsersBlogs.

The blogger.getUsersBlogs endpoint does not currently work on Multisite environments which require HTTPS.

This changes wp_xmlrpc_server::_multisite_getUsersBlogs() to call the method directly instead of relying on a new IXR_Client request, which only supports HTTP.

Props dd32.
Fixes #56492.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-xmlrpc-server.php

    r54321 r54468  
    48604860        $path   = $current_blog->path . 'xmlrpc.php';
    48614861
    4862         $rpc = new IXR_Client( set_url_scheme( "http://{$domain}{$path}" ) );
    4863         $rpc->query( 'wp.getUsersBlogs', $args[1], $args[2] );
    4864         $blogs = $rpc->getResponse();
    4865 
    4866         if ( isset( $blogs['faultCode'] ) ) {
    4867             return new IXR_Error( $blogs['faultCode'], $blogs['faultString'] );
     4862        $blogs = $this->wp_getUsersBlogs( $args );
     4863        if ( $blogs instanceof IXR_Error ) {
     4864            return $blogs;
    48684865        }
    48694866
Note: See TracChangeset for help on using the changeset viewer.