From 1fb94edb998613e17baf3b028c8b0c81b939686b Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 25 Aug 2015 21:02:14 +0000 Subject: [PATCH] In `get_home_url()`, import the `$pagenow` global to avoid having to check if it exists before comparing against it. Props KalenJohnson. See #33545. git-svn-id: https://develop.svn.wordpress.org/trunk@33736 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/link-template.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wp-includes/link-template.php b/src/wp-includes/link-template.php index 5a80a1cfde..bee11f9e36 100644 --- a/src/wp-includes/link-template.php +++ b/src/wp-includes/link-template.php @@ -2732,6 +2732,8 @@ 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() ) { @@ -2743,7 +2745,7 @@ function get_home_url( $blog_id = null, $path = '', $scheme = null ) { } if ( ! in_array( $scheme, array( 'http', 'https', 'relative' ) ) ) { - if ( is_ssl() && ! is_admin() && 'wp-login.php' !== $GLOBALS['pagenow'] ) + if ( is_ssl() && ! is_admin() && 'wp-login.php' !== $pagenow ) $scheme = 'https'; else $scheme = parse_url( $url, PHP_URL_SCHEME );