diff --git a/wp-includes/rest-api/rest-functions.php b/wp-includes/rest-api/rest-functions.php index 947efce90e..c3f6be0d43 100644 --- a/wp-includes/rest-api/rest-functions.php +++ b/wp-includes/rest-api/rest-functions.php @@ -254,6 +254,13 @@ function get_rest_url( $blog_id = null, $path = '/', $scheme = 'rest' ) { $url = add_query_arg( 'rest_route', $path, $url ); } + if ( is_ssl() ) { + // If the current host is the same as the REST URL host, force the REST URL scheme to HTTPS + if ( $_SERVER['SERVER_NAME'] === parse_url( get_home_url( $blog_id ), PHP_URL_HOST ) ) { + $url = set_url_scheme( $url, 'https' ); + } + } + /** * Filter the REST URL. * diff --git a/wp-includes/version.php b/wp-includes/version.php index 162fc260c7..5fc4e6c009 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-35350'; +$wp_version = '4.4-alpha-35351'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.