mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-08 08:31:48 +01:00
Script Loader: Fix protocol-relative URLs for the preconnect
relation type.
`wp_resource_hints()` parses the URL for the `preconnect` and `dns-prefetch` relation types to ensure correct values for both. While protocol-relative URLs are supported for `dns-prefetch`, the double slash was lost for `preconnect`. Props swissspidy, peterwilsoncc. Props azaozz for review. Fixes #37652. Built from https://develop.svn.wordpress.org/trunk@38255 git-svn-id: http://core.svn.wordpress.org/trunk@38196 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1691196110
commit
25338b6f02
@ -2839,12 +2839,11 @@ function wp_resource_hints() {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( 'dns-prefetch' === $relation_type ) {
|
if ( 'preconnect' === $relation_type && ! empty( $parsed['scheme'] ) ) {
|
||||||
$url = '//' . $parsed['host'];
|
|
||||||
} else if ( ! empty( $parsed['scheme'] ) ) {
|
|
||||||
$url = $parsed['scheme'] . '://' . $parsed['host'];
|
$url = $parsed['scheme'] . '://' . $parsed['host'];
|
||||||
} else {
|
} else {
|
||||||
$url = $parsed['host'];
|
// Use protocol-relative URLs for dns-prefetch or if scheme is missing.
|
||||||
|
$url = '//' . $parsed['host'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.7-alpha-38254';
|
$wp_version = '4.7-alpha-38255';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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
Block a user