WordPress.org

Make WordPress Core

Ticket #34634: 34634.diff

File 34634.diff, 679 bytes (added by Chouby, 6 years ago)
  • src/wp-includes/load.php

     
    104104
    105105        // Fix empty PHP_SELF
    106106        $PHP_SELF = $_SERVER['PHP_SELF'];
    107         if ( empty( $PHP_SELF ) )
    108                 $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace( '/(\?.*)?$/', '', $_SERVER["REQUEST_URI"] );
     107        if ( empty( $PHP_SELF ) ) {
     108                if ( false === strpos( $_SERVER["REQUEST_URI"], '.php' ) ) {
     109                        $_SERVER['PHP_SELF'] = $PHP_SELF = '/index.php';
     110                } else {
     111                        $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace( '/(\?.*)?$/', '', $_SERVER["REQUEST_URI"] );
     112                }
     113        }
    109114}
    110115
    111116/**