Make WordPress Core

Ticket #47398: wp-favicon-request.diff

File wp-favicon-request.diff, 1.1 KB (added by joostdevalk, 5 years ago)

Patch

  • wp-includes/load.php

     
    157157}
    158158
    159159/**
    160  * Don't load all of WordPress when handling a favicon.ico request.
    161  *
    162  * Instead, send the headers for a zero-length favicon and bail.
    163  *
    164  * @since 3.0.0
    165  */
    166 function wp_favicon_request() {
    167         if ( '/favicon.ico' == $_SERVER['REQUEST_URI'] ) {
    168                 header( 'Content-Type: image/vnd.microsoft.icon' );
    169                 exit;
    170         }
    171 }
    172 
    173 /**
    174160 * Die with a maintenance message when conditions are met.
    175161 *
    176162 * Checks for a file in the WordPress root directory named ".maintenance".
  • wp-settings.php

     
    6767// Standardize $_SERVER variables across setups.
    6868wp_fix_server_vars();
    6969
    70 // Check if we have received a request due to missing favicon.ico
    71 wp_favicon_request();
    72 
    7370// Check if we're in maintenance mode.
    7471wp_maintenance();
    7572