Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#37118 closed enhancement (fixed)

Move call of get_blog_details() inside of ms_site_check()

Reported by: danielbachhuber Owned by: jeremyfelt
Priority: normal Milestone: 4.6
Component: Bootstrap/Load Version:
Severity: normal Keywords: has-patch commit
Cc: Focuses: multisite

Description

get_blog_details() is unnecessarily called at the top of ms_site_check(). It should be called when the blog's details are actually needed.

When a non-web context is bypassing ms_site_check() using the ms_site_check filter, the call to get_blog_details() causes a MySQL error notice when WordPress isn't yet installed.

Related #34936
From https://github.com/wp-cli/wp-cli/issues/2278#issuecomment-226634504

Attachments (1)

37118.1.diff (697 bytes ) - added by danielbachhuber 10 years ago.

Download all attachments as: .zip

Change History (5)

#1 @danielbachhuber
10 years ago

  • Owner set to jorbin
  • Status newassigned

#2 @jeremyfelt
10 years ago

  • Focuses multisite added
  • Keywords commit added

+1

Noting #36935 for cross-reference. We'll be able to replace this with get_site() at some point, but the move is good either way.

#3 @jeremyfelt
10 years ago

  • Owner changed from jorbin to jeremyfelt
  • Status assignedreviewing

#4 @jeremyfelt
10 years ago

  • Resolutionfixed
  • Status reviewingclosed

In 37850:

Multisite: Move call of get_blog_details() inside ms_site_check().

This allows the ms_site_check filter or is_super_admin() check to return true before get_blog_details() is used.

Props danielbachhuber.
Fixes #37118.

Note: See TracTickets for help on using tickets.