Honor https in home option.

fixes #20759


git-svn-id: https://develop.svn.wordpress.org/trunk@21937 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2012-09-21 12:36:50 +00:00
parent 0da6a9dfa2
commit 0012dd0e73
1 changed files with 7 additions and 3 deletions

View File

@ -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 )