WordPress.org

Make WordPress Core

Ticket #17047: uri_no_host.2.patch

File uri_no_host.2.patch, 744 bytes (added by sterlo, 4 years ago)

Patch against latest wp-includes/load.php (replaced previous patch)

  • wp-includes/load.php

    diff --git a/wp-includes/load.php b/wp-includes/load.php
    index 298dd7d..cd6ddcd 100644
    a b function wp_fix_server_vars() { 
    4646 
    4747        $_SERVER = array_merge( $default_server_values, $_SERVER ); 
    4848 
     49        // Fix bad assumption of REQUEST_URI 
     50        // http://en.wikipedia.org/wiki/URI_scheme#Examples 
     51        // http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.2 
     52        $_SERVER[ 'REQUEST_URI' ] = preg_replace( '(^https?://' . $_SERVER[ 'HTTP_HOST' ] . ')' , NULL , $_SERVER[ 'REQUEST_URI' ] ); 
     53 
    4954        // Fix for IIS when running with PHP ISAPI 
    5055        if ( empty( $_SERVER['REQUEST_URI'] ) || ( php_sapi_name() != 'cgi-fcgi' && preg_match( '/^Microsoft-IIS\//', $_SERVER['SERVER_SOFTWARE'] ) ) ) { 
    5156