Make WordPress Core

Ticket #17047: uri_no_host.patch

File uri_no_host.patch, 745 bytes (added by sterlo, 13 years ago)

New patch: the regex should be case insensitive.

  • 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' ] . ')i' , 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