From a8fa7b3ad25a293d980163e0b12b1ef6d2844596 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 21 Sep 2012 12:36:50 +0000 Subject: [PATCH] Honor https in home option. fixes #20759 git-svn-id: http://core.svn.wordpress.org/trunk@21937 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 0532e0abe0..681c53cfad 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -1892,9 +1892,6 @@ function home_url( $path = '', $scheme = null ) { function get_home_url( $blog_id = null, $path = '', $scheme = null ) { $orig_scheme = $scheme; - if ( ! in_array( $scheme, array( 'http', 'https', 'relative' ) ) ) - $scheme = is_ssl() && !is_admin() ? 'https' : 'http'; - if ( empty( $blog_id ) || !is_multisite() ) { $url = get_option( 'home' ); } else { @@ -1903,6 +1900,13 @@ function get_home_url( $blog_id = null, $path = '', $scheme = null ) { restore_current_blog(); } + if ( ! in_array( $scheme, array( 'http', 'https', 'relative' ) ) ) { + if ( is_ssl() && ! is_admin() ) + $scheme = 'https'; + else + $scheme = parse_url( $url, PHP_URL_SCHEME ); + } + $url = set_url_scheme( $url, $scheme ); if ( ! empty( $path ) && is_string( $path ) && strpos( $path, '..' ) === false )