Ensure that the scheme used in the URL returned by `get_blogaddress_by_id()` always reflects the blog's URL, instead of using `http`.
Props thomaswm Fixes #14867 Built from https://develop.svn.wordpress.org/trunk@35446 git-svn-id: http://core.svn.wordpress.org/trunk@35410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
746ba4c9c4
commit
8cbd79e3dc
|
@ -38,8 +38,16 @@ function wpmu_update_blogs_date() {
|
||||||
* @return string Full URL of the blog if found. Empty string if not.
|
* @return string Full URL of the blog if found. Empty string if not.
|
||||||
*/
|
*/
|
||||||
function get_blogaddress_by_id( $blog_id ) {
|
function get_blogaddress_by_id( $blog_id ) {
|
||||||
$bloginfo = get_blog_details( (int) $blog_id, false ); // only get bare details!
|
$bloginfo = get_blog_details( (int) $blog_id );
|
||||||
return ( $bloginfo ) ? esc_url( 'http://' . $bloginfo->domain . $bloginfo->path ) : '';
|
|
||||||
|
if ( empty( $bloginfo ) ) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
$scheme = parse_url( $bloginfo->home, PHP_URL_SCHEME );
|
||||||
|
$scheme = empty( $scheme ) ? 'http' : $scheme;
|
||||||
|
|
||||||
|
return esc_url( $scheme . '://' . $bloginfo->domain . $bloginfo->path );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -216,9 +224,10 @@ function get_blog_details( $fields = null, $get_all = true ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
switch_to_blog( $blog_id );
|
switch_to_blog( $blog_id );
|
||||||
$details->blogname = get_option( 'blogname' );
|
$details->blogname = get_option( 'blogname' );
|
||||||
$details->siteurl = get_option( 'siteurl' );
|
$details->siteurl = get_option( 'siteurl' );
|
||||||
$details->post_count = get_option( 'post_count' );
|
$details->post_count = get_option( 'post_count' );
|
||||||
|
$details->home = get_option( 'home' );
|
||||||
restore_current_blog();
|
restore_current_blog();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.4-beta2-35445';
|
$wp_version = '4.4-beta2-35446';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue