Make WordPress Core

Ticket #34219: 34219.2.diff

File 34219.2.diff, 1.5 KB (added by swissspidy, 9 years ago)
  • src/wp-includes/rest-api/rest-functions.php

    diff --git src/wp-includes/rest-api/rest-functions.php src/wp-includes/rest-api/rest-functions.php
    index 90bb2e7..909bf5e 100644
    function rest_api_register_rewrites() { 
    132132/**
    133133 * Registers the default REST API filters.
    134134 *
    135  * @since 4.4.0
     135 * Attached to the {@see 'rest_api_init'} action
     136 * to make testing and disabling these filters easier.
    136137 *
    137  * @internal This will live in default-filters.php
     138 * @since 4.4.0
    138139 */
    139140function rest_api_default_filters() {
    140141        // Deprecated reporting.
  • src/wp-includes/rest-api/rest-functions.php

    diff --git src/wp-includes/rest-api/rest-functions.php src/wp-includes/rest-api/rest-functions.php
    index 909bf5e..275ca5f 100644
    function get_rest_url( $blog_id = null, $path = '/', $scheme = 'rest' ) { 
    255255                $url = add_query_arg( 'rest_route', $path, $url );
    256256        }
    257257
    258         if ( is_ssl() ) { 
    259                 // If the current host is the same as the REST URL host, force the REST URL scheme to HTTPS 
    260                 if ( $_SERVER['SERVER_NAME'] === parse_url( get_home_url( $blog_id ), PHP_URL_HOST ) ) { 
    261                         $url = set_url_scheme( $url, 'https' ); 
    262                 } 
    263         } 
     258        if ( is_ssl() ) {
     259                // If the current host is the same as the REST URL host, force the REST URL scheme to HTTPS
     260                if ( $_SERVER['SERVER_NAME'] === parse_url( get_home_url( $blog_id ), PHP_URL_HOST ) ) {
     261                        $url = set_url_scheme( $url, 'https' );
     262                }
     263        }
    264264
    265265        /**
    266266         * Filter the REST URL.