wordpress update 6.6.2

This commit is contained in:
Tony Volpe
2024-09-10 12:45:50 -04:00
parent daa614524b
commit 44b413346f
46 changed files with 309 additions and 174 deletions

View File

@@ -1366,13 +1366,17 @@ function wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attac
* (which is to say, when they share the domain name of the current request).
*/
if ( is_ssl() && ! str_starts_with( $image_baseurl, 'https' ) ) {
// Since the `Host:` header might contain a port we should
// compare it against the image URL using the same port.
/*
* Since the `Host:` header might contain a port, it should
* be compared against the image URL using the same port.
*/
$parsed = parse_url( $image_baseurl );
$domain = $parsed['host'];
$domain = isset( $parsed['host'] ) ? $parsed['host'] : '';
if ( isset( $parsed['port'] ) ) {
$domain .= ':' . $parsed['port'];
}
if ( $_SERVER['HTTP_HOST'] === $domain ) {
$image_baseurl = set_url_scheme( $image_baseurl, 'https' );
}