Make WordPress Core

Opened 8 years ago

Closed 8 years ago

#37118 closed enhancement (fixed)

Move call of get_blog_details() inside of ms_site_check()

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


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

Attachments (1)

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

Download all attachments as: .zip

Change History (5)

#1 @danielbachhuber
8 years ago

  • Owner set to jorbin
  • Status changed from new to assigned

#2 @jeremyfelt
8 years ago

  • Focuses multisite added
  • Keywords commit added


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

  • Owner changed from jorbin to jeremyfelt
  • Status changed from assigned to reviewing

#4 @jeremyfelt
8 years ago

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

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.