Skip to:
Content

BuddyPress.org

Ticket #4948: 4948.01.patch

File 4948.01.patch, 1.1 KB (added by r-a-y, 12 years ago)
  • bp-core/bp-core-avatars.php

    function bp_core_avatar_url() { 
    848848                if ( defined( 'BP_AVATAR_URL' ) ) {
    849849                        $baseurl = BP_AVATAR_URL;
    850850                } else {
     851                        // If multisite, and we're not on the BP root blog, switch to it
     852                        if ( is_multisite() && ! bp_is_root_blog() ) {
     853                                switch_to_blog( bp_get_root_blog_id() );
     854                        }
     855
    851856                        // Get upload directory information from current site
    852857                        $upload_dir = wp_upload_dir();
    853858
    function bp_core_avatar_url() { 
    862867                                if ( is_ssl() )
    863868                                        $baseurl = str_replace( 'http://', 'https://', $baseurl );
    864869
    865                                 // If multisite, and current blog does not match root blog, make adjustments
    866                                 if ( is_multisite() && bp_get_root_blog_id() != get_current_blog_id() )
    867                                         $baseurl = trailingslashit( get_blog_option( bp_get_root_blog_id(), 'home' ) ) . get_blog_option( bp_get_root_blog_id(), 'upload_path' );
    868870                        }
     871
     872                        // Will bail if not switched
     873                        restore_current_blog();
    869874                }
    870875
    871876                // Stash in $bp for later use