Skip to:
Content

BuddyPress.org

Changeset 5956


Ignore:
Timestamp:
04/01/2012 09:58:29 PM (10 years ago)
Author:
djpaul
Message:

Fix https URL handling for gravatars and other BuddyPress content

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-avatars.php

    r5927 r5956  
    235235    $avatar_loc->path  = trailingslashit( bp_core_avatar_upload_path() );
    236236    $avatar_loc->url   = trailingslashit( bp_core_avatar_url() );
     237
    237238    $avatar_loc->dir   = trailingslashit( $avatar_dir );
    238239    $avatar_folder_url = apply_filters( 'bp_core_avatar_folder_url', ( $avatar_loc->url  . $avatar_loc->dir . $item_id ), $item_id, $object, $avatar_dir );
     
    776777    if ( isset( $bp->avatar->url ) ) {
    777778        $baseurl = $bp->avatar->url;
     779
    778780    } else {
    779781        // If this value has been set in a constant, just use that
     
    790792            } else {
    791793                $baseurl = $upload_dir['baseurl'];
    792        
     794
     795                // If we're using https, update the protocol. Workaround for WP13941, WP15928, WP19037.
     796                if ( is_ssl() )
     797                    $baseurl = str_replace( 'http://', 'https://', $baseurl );
     798
    793799                // If multisite, and current blog does not match root blog, make adjustments
    794800                if ( is_multisite() && bp_get_root_blog_id() != get_current_blog_id() )
     
    796802            }
    797803        }
    798        
     804
    799805        // Stash in $bp for later use
    800806        $bp->avatar->url = $baseurl;
  • trunk/bp-loader.php

    r5955 r5956  
    360360            define( 'BP_PLUGIN_DIR', trailingslashit( WP_PLUGIN_DIR . '/buddypress' ) );
    361361
    362         if ( !defined( 'BP_PLUGIN_URL' ) )
    363             define( 'BP_PLUGIN_URL', plugin_dir_url ( __FILE__ ) );
     362        if ( !defined( 'BP_PLUGIN_URL' ) ) {
     363            $plugin_url = plugin_dir_url( __FILE__ );
     364
     365            // If we're using https, update the protocol. Workaround for WP13941, WP15928, WP19037.
     366            if ( is_ssl() )
     367                $plugin_url = str_replace( 'http://', 'https://', $plugin_url );
     368
     369            define( 'BP_PLUGIN_URL', $plugin_url );
     370        }
    364371
    365372        // The search slug has to be defined nice and early because of the way
Note: See TracChangeset for help on using the changeset viewer.