Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/07/2014 01:03:38 AM (11 years ago)
Author:
boonebgorges
Message:

Improve go_to() current_blog determining logic in test suite

It's necessary to zero out the current_blog and current_site globals, and then
to use some of the additional fallbacks in ms-settings.php to determine the
correct site.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/includes/testcase.php

    r7664 r7818  
    9393        // REQUEST_URI; mostly copied from /wp-includes/ms-settings.php
    9494        if ( is_multisite() ) {
     95            $GLOBALS['current_blog'] = $GLOBALS['current_site'] = $GLOBALS['blog_id'] = null;
     96
    9597            $domain = addslashes( $_SERVER['HTTP_HOST'] );
    9698            if ( false !== strpos( $domain, ':' ) ) {
     
    134136            }
    135137
     138            if ( $GLOBALS['current_site'] && ! $GLOBALS['current_blog'] ) {
     139                $GLOBALS['current_blog'] = get_blog_details( array( 'domain' => $GLOBALS['current_site']->domain, 'path' => $GLOBALS['current_site']->path ), false );
     140            }
     141
    136142            $GLOBALS['blog_id'] = $GLOBALS['current_blog']->blog_id;
    137143        }
Note: See TracChangeset for help on using the changeset viewer.