WordPress.org

Make WordPress Core

Ticket #33034: refactor_SCRIPT_FILENAME_check.patch

File refactor_SCRIPT_FILENAME_check.patch, 672 bytes (added by wildpeat, 6 years ago)

Patch

  • wp-includes/load.php

     
    8080        }
    8181
    8282        // Fix for PHP as CGI hosts that set SCRIPT_FILENAME to something ending in php.cgi for all requests
    83         if ( isset( $_SERVER['SCRIPT_FILENAME'] ) && ( strpos( $_SERVER['SCRIPT_FILENAME'], 'php.cgi' ) == strlen( $_SERVER['SCRIPT_FILENAME'] ) - 7 ) )
     83        if ( isset( $_SERVER['SCRIPT_FILENAME'] ) && preg_match( '/php\.cgi$/', $_SERVER['SCRIPT_FILENAME'] ) )
    8484                $_SERVER['SCRIPT_FILENAME'] = $_SERVER['PATH_TRANSLATED'];
    8585
    8686        // Fix for Dreamhost and other PHP as CGI hosts