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


git-svn-id: https://develop.svn.wordpress.org/trunk@36750 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
John Blackbourn
2016-02-28 02:12:13 +00:00
parent 717c1c4041
commit 54adcce28d
2 changed files with 56 additions and 1 deletions

View File

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