Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/11/2011 06:02:47 PM (13 years ago)
Author:
boonebgorges
Message:

Audit of the use of ->blog_id to change to ->blogid where possible, to better account for switch_to_blog() use. Fixes #2984. Props wpmuguru

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/admin/bp-core-update.php

    r4106 r4107  
    740740
    741741    function step_ms_update_save() {
    742         global $current_blog;
     742        global $wpdb;
    743743
    744744        if ( isset( $_POST['submit'] ) ) {
     
    762762            } else {
    763763                // Make sure that the pages are created on the BP_ROOT_BLOG, no matter which Dashboard the setup is being run on
    764                 if ( $current_blog->blog_id != BP_ROOT_BLOG && !defined( 'BP_ENABLE_MULTIBLOG' ) )
     764                if ( $wpdb->blogid != BP_ROOT_BLOG && !defined( 'BP_ENABLE_MULTIBLOG' ) )
    765765                    switch_to_blog( BP_ROOT_BLOG );
    766766
     
    771771                update_option( 'bp-pages', $bp_pages );
    772772
    773                 if ( $current_blog->blog_id != BP_ROOT_BLOG )
     773                if ( $wpdb->blogid != BP_ROOT_BLOG )
    774774                    restore_current_blog();
    775775
     
    810810
    811811    function step_pages_save() {
    812         global $current_blog;
     812        global $wpdb;
    813813
    814814        if ( isset( $_POST['submit'] ) && isset( $_POST['bp_pages'] ) ) {
     
    816816
    817817            // Make sure that the pages are created on the BP_ROOT_BLOG, no matter which Dashboard the setup is being run on
    818             if ( !empty( $current_blog->blog_id ) && $current_blog->blog_id != BP_ROOT_BLOG && !defined( 'BP_ENABLE_MULTIBLOG' ) )
     818            if ( !empty( $wpdb->blogid ) && $wpdb->blogid != BP_ROOT_BLOG && !defined( 'BP_ENABLE_MULTIBLOG' ) )
    819819                switch_to_blog( BP_ROOT_BLOG );
    820820
     
    829829            update_option( 'bp-pages', $bp_pages );
    830830
    831             if ( !empty( $current_blog->blog_id ) && $current_blog->blog_id != BP_ROOT_BLOG )
     831            if ( !empty( $wpdb->blogid ) && $wpdb->blogid != BP_ROOT_BLOG )
    832832                restore_current_blog();
    833833
     
    853853                    $permalink_structure = preg_replace( '#/+#', '/', '/' . $_POST['permalink_structure'] );
    854854
    855                 if ( ( defined( 'VHOST' ) && constant( 'VHOST' ) == 'no' ) && $permalink_structure != '' && $current_site->domain.$current_site->path == $current_blog->domain.$current_blog->path )
     855                if ( ( defined( 'VHOST' ) && constant( 'VHOST' ) == 'no' ) && $permalink_structure != '' && $current_site->domain . $current_site->path == $current_blog->domain . $current_blog->path )
    856856                    $permalink_structure = '/blog' . $permalink_structure;
    857857
Note: See TracChangeset for help on using the changeset viewer.