From f7101e6cbf406d8bf3357b52e61d48ca1a359043 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Sun, 28 Feb 2016 02:13:25 +0000 Subject: [PATCH] Rewrite Rules: Ensure `url_to_postid()` operates as expected when it's used in the context of another site within a Multisite network that uses mixed URL schemes. Fixes #35531 Built from https://develop.svn.wordpress.org/trunk@36750 git-svn-id: http://core.svn.wordpress.org/trunk@36717 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/rewrite.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/rewrite.php b/wp-includes/rewrite.php index 0c92446d0c..329e0ac91f 100644 --- a/wp-includes/rewrite.php +++ b/wp-includes/rewrite.php @@ -487,7 +487,8 @@ function url_to_postid( $url ) { $url = $url_split[0]; // Set the correct URL scheme. - $url = set_url_scheme( $url ); + $scheme = parse_url( home_url(), PHP_URL_SCHEME ); + $url = set_url_scheme( $url, $scheme ); // Add 'www.' if it is absent and should be there if ( false !== strpos(home_url(), '://www.') && false === strpos($url, '://www.') ) diff --git a/wp-includes/version.php b/wp-includes/version.php index 8d3be1a008..c3a51fb856 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.5-beta1-36749'; +$wp_version = '4.5-beta1-36750'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.