Make WordPress Core

Ticket #47854: 47854.diff

File 47854.diff, 613 bytes (added by paulschreiber, 6 years ago)
  • src/wp-includes/rest-api.php

     
    375375
    376376        if ( is_ssl() ) {
    377377                // If the current host is the same as the REST URL host, force the REST URL scheme to HTTPS.
    378                 if ( $_SERVER['SERVER_NAME'] === parse_url( get_home_url( $blog_id ), PHP_URL_HOST ) ) {
     378                if ( isset( $_SERVER['SERVER_NAME'] ) && $_SERVER['SERVER_NAME'] === parse_url( get_home_url( $blog_id ), PHP_URL_HOST ) ) {
    379379                        $url = set_url_scheme( $url, 'https' );
    380380                }
    381381        }