WordPress.org

Make WordPress Core

Ticket #12283: 12283.2.patch

File 12283.2.patch, 1.2 KB (added by hakre, 4 years ago)

Second patch incl. some $_SERVER defaults in case those are not set (some environments do not set them)

  • wordpress/wp-includes/theme.php

     
    624624        if ($stylesheet_or_template) { 
    625625                $theme_roots = get_theme_roots(); 
    626626 
    627                 if ( $theme_roots[$stylesheet_or_template] ) 
     627                if ( isset( $theme_roots[$stylesheet_or_template] ) && $theme_roots[$stylesheet_or_template] ) 
    628628                        $theme_root = WP_CONTENT_DIR . $theme_roots[$stylesheet_or_template]; 
    629629                else 
    630630                        $theme_root = WP_CONTENT_DIR . '/themes'; 
  • wordpress/wp-settings.php

     
    3939 
    4040// Standardize $_SERVER variables across setups. 
    4141wp_fix_server_vars(); 
     42         
     43/** 
     44 * global $_SERVER array initialisation if certain indexes are not used 
     45 */      
     46foreach ( array( 'HTTP_HOST', 'REQUEST_URI', 'SERVER_SOFTWARE' ) as $var ) 
     47        if ( !isset($_SERVER[$var]) ) 
     48                $_SERVER[$var] = ''; 
    4249 
    4350// Check for the required PHP version and for the MySQL extension or a database drop-in. 
    4451wp_check_php_mysql_versions();