mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 15:50:09 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@34890 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user