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:
parent
7547dc5125
commit
b3a07ab8ea
|
@ -339,6 +339,9 @@ function url_to_postid( $url ) {
|
||||||
$url_split = explode('?', $url);
|
$url_split = explode('?', $url);
|
||||||
$url = $url_split[0];
|
$url = $url_split[0];
|
||||||
|
|
||||||
|
// Set the correct URL scheme.
|
||||||
|
$url = set_url_scheme( $url );
|
||||||
|
|
||||||
// Add 'www.' if it is absent and should be there
|
// Add 'www.' if it is absent and should be there
|
||||||
if ( false !== strpos(home_url(), '://www.') && false === strpos($url, '://www.') )
|
if ( false !== strpos(home_url(), '://www.') && false === strpos($url, '://www.') )
|
||||||
$url = str_replace('://', '://www.', $url);
|
$url = str_replace('://', '://www.', $url);
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue