From 640c03842e942b59ce18bf939b3a05e04df33ea0 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 2 Feb 2021 19:03:04 +0000 Subject: [PATCH] General: Remove admin and login exceptions for `https` in `get_home_url()`. Previously, `get_home_url()` would automatically switch to `https` if the current request is already `https`, but would only do so on the front end. This addresses the inconsistent behavior of returning different values in the admin and on the frontend. Follow-up to [12598], [21937], [24844]. Props herregroen, mukesh27. Fixes #52421. Built from https://develop.svn.wordpress.org/trunk@50156 git-svn-id: http://core.svn.wordpress.org/trunk@49835 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/link-template.php | 6 +----- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php index 83e7f607be..daf73ca016 100644 --- a/wp-includes/link-template.php +++ b/wp-includes/link-template.php @@ -3253,8 +3253,6 @@ function home_url( $path = '', $scheme = null ) { * * @since 3.0.0 * - * @global string $pagenow - * * @param int $blog_id Optional. Site ID. Default null (current site). * @param string $path Optional. Path relative to the home URL. Default empty. * @param string|null $scheme Optional. Scheme to give the home URL context. Accepts @@ -3262,8 +3260,6 @@ function home_url( $path = '', $scheme = null ) { * @return string Home URL link with optional path appended. */ function get_home_url( $blog_id = null, $path = '', $scheme = null ) { - global $pagenow; - $orig_scheme = $scheme; if ( empty( $blog_id ) || ! is_multisite() ) { @@ -3275,7 +3271,7 @@ function get_home_url( $blog_id = null, $path = '', $scheme = null ) { } if ( ! in_array( $scheme, array( 'http', 'https', 'relative' ), true ) ) { - if ( is_ssl() && ! is_admin() && 'wp-login.php' !== $pagenow ) { + if ( is_ssl() ) { $scheme = 'https'; } else { $scheme = parse_url( $url, PHP_URL_SCHEME ); diff --git a/wp-includes/version.php b/wp-includes/version.php index df03a80296..afa1d42eef 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.7-alpha-50155'; +$wp_version = '5.7-alpha-50156'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.