Changeset 58097 for trunk/src/wp-includes/media.php
- Timestamp:
- 05/04/2024 07:23:31 PM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r58037 r58097 1364 1364 * (which is to say, when they share the domain name of the current request). 1365 1365 */ 1366 if ( is_ssl() && ! str_starts_with( $image_baseurl, 'https' ) && parse_url( $image_baseurl, PHP_URL_HOST ) === $_SERVER['HTTP_HOST'] ) { 1367 $image_baseurl = set_url_scheme( $image_baseurl, 'https' ); 1366 if ( is_ssl() && ! str_starts_with( $image_baseurl, 'https' ) ) { 1367 // Since the `Host:` header might contain a port we should 1368 // compare it against the image URL using the same port. 1369 $parsed = parse_url( $image_baseurl ); 1370 $domain = $parsed['host']; 1371 if ( isset( $parsed['port'] ) ) { 1372 $domain .= ':' . $parsed['port']; 1373 } 1374 if ( $_SERVER['HTTP_HOST'] === $domain ) { 1375 $image_baseurl = set_url_scheme( $image_baseurl, 'https' ); 1376 } 1368 1377 } 1369 1378
Note: See TracChangeset
for help on using the changeset viewer.