WordPress.org

Make WordPress Core

Ticket #17749: 17749.2.diff

File 17749.2.diff, 787 bytes (added by ryan, 7 years ago)
  • wp-includes/load.php

     
    3939 * @since 3.0.0
    4040 */
    4141function wp_fix_server_vars() {
    42         global $PHP_SELF;
    43 
    4442        $default_server_values = array(
    4543                'SERVER_SOFTWARE' => '',
    4644                'REQUEST_URI' => '',
     
    8785                unset( $_SERVER['PATH_INFO'] );
    8886
    8987        // Fix empty PHP_SELF
    90         $PHP_SELF = $_SERVER['PHP_SELF'];
    91         if ( empty( $PHP_SELF ) )
    92                 $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace( '/(\?.*)?$/', '', $_SERVER["REQUEST_URI"] );
     88        if ( empty( $_SERVER['PHP_SELF'] ) )
     89                $_SERVER['PHP_SELF'] = preg_replace( '/(\?.*)?$/', '', $_SERVER['REQUEST_URI'] );
     90
     91        $GLOBALS[ 'PHP_SELF' ] = $_SERVER[ 'PHP_SELF' ];
    9392}
    9493
    9594/**