Rewrite/Permalinks/Canonical: in `url_to_postid()`, call `set_url_scheme()` on the URL to combat mixed content issues and find posts cross-scheme.

Adds unit tests.

Props swissspidy.
Fixes #34144.

Built from https://develop.svn.wordpress.org/trunk@34890


git-svn-id: http://core.svn.wordpress.org/trunk@34855 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-10-07 01:07:24 +00:00
parent 7547dc5125
commit b3a07ab8ea
2 changed files with 4 additions and 1 deletions

View File

@ -339,6 +339,9 @@ function url_to_postid( $url ) {
$url_split = explode('?', $url);
$url = $url_split[0];
// Set the correct URL scheme.
$url = set_url_scheme( $url );
// Add 'www.' if it is absent and should be there
if ( false !== strpos(home_url(), '://www.') && false === strpos($url, '://www.') )
$url = str_replace('://', '://www.', $url);

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-34889';
$wp_version = '4.4-alpha-34890';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.