Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#10174 closed defect (bug) (invalid)

switch_to_blog() function in xml-rpc.php is not defined

Reported by: Denis-de-Bernardy Owned by: josephscott
Milestone: Priority: normal
Severity: normal Version:
Component: XML-RPC Keywords: has-patch dev-feedback
Focuses: Cc:


Found this while looking into #2699. There is a function call, switch_to_blog(), in xml-rpc.php, which I assume is for WPMU.

The function is not defined in WP.

Attachments (1)

10174.diff (396 bytes) - added by Denis-de-Bernardy 6 years ago.

Download all attachments as: .zip

Change History (3)

#1 @Denis-de-Bernardy
6 years ago

  • Keywords dev-feedback added
  • Summary changed from switch_to_blog() undefined to switch_to_blog() function in xml-rpc.php is not defined

#2 @josephscott
6 years ago

  • Milestone 2.8.1 deleted
  • Resolution set to invalid
  • Status changed from new to closed

This isn't needed because the top of the wp_getUsersBlogs() function checks for the existence of the is_site_admin() function, which only exists in WPMU. If the is_site_admin() function doesn't exist (as is the case in WP installs) then it uses the blogger_getUsersBlogs() function to process the request. So the only way for the code execution to reach the point of calling switch_to_blog() is if it's running on a WPMU install.

I'm closing this as invalid, if it turns out that there are situations where this doesn't hold true then we can re-open it.

Note: See TracTickets for help on using tickets.