Make WordPress Core

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#12023 closed defect (bug) (fixed)

switch_to_blog does not check if the blog really exists

Reported by: wpmuguru Owned by:
Milestone: 3.0 Priority: normal
Severity: normal Version:
Component: Multisite Keywords:
Focuses: Cc:


MU Trac Ticket: http://trac.mu.wordpress.org/ticket/1162

switch_to_blog function imo should check if the blog specified exists or not, if not return FALSE instead of TRUE.

Change History (3)

#1 @wpmuguru
12 years ago

(In [13047]) add option to validate on switch_to_blog, see #12023

#2 @wpmuguru
12 years ago

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

To check if the blog really exists when using switch_to_blog in a plugin, add a second parameter true

$exists = switch_to_blog($blog_id, true);

#3 @nacin
12 years ago

  • Milestone changed from Unassigned to 3.0
Note: See TracTickets for help on using tickets.