Make WordPress Core

Ticket #12283: 12283.3.patch

File 12283.3.patch, 1.1 KB (added by hakre, 15 years ago)
  • load.php

     
    8282        $PHP_SELF = $_SERVER['PHP_SELF'];
    8383        if ( empty( $PHP_SELF ) )
    8484                $_SERVER['PHP_SELF'] = $PHP_SELF = preg_replace( "/(\?.*)?$/",'',$_SERVER["REQUEST_URI"] );
     85               
     86               
     87        /**
     88         * global $_SERVER array initialisation if certain indexes are not used
     89         * to prevent warnings on all requests.
     90         */     
     91        foreach ( array( 'HTTP_HOST', 'REQUEST_URI', 'SERVER_SOFTWARE' ) as $var )
     92                if ( !isset($_SERVER[$var]) )
     93                        $_SERVER[$var] = '';
    8594}
    8695
    8796/**
  • theme.php

     
    624624        if ($stylesheet_or_template) {
    625625                $theme_roots = get_theme_roots();
    626626
    627                 if ( $theme_roots[$stylesheet_or_template] )
     627                if ( !empty( $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';