diff --git a/wp-includes/load.php b/wp-includes/load.php index e18fd2345..fe707411f 100644 --- a/wp-includes/load.php +++ b/wp-includes/load.php @@ -104,6 +104,20 @@ function wp_check_php_mysql_versions() { die( /*WP_I18N_OLD_MYSQL*/'Your PHP installation appears to be missing the MySQL extension which is required by WordPress.'/*/WP_I18N_OLD_MYSQL*/ ); } +/** + * Don't load all of WordPress when handling a favicon.ico request. + * Instead, send the headers for a zero-length favicon and bail. + * + * @since 3.0.0 + */ +function wp_favicon_request() { + if ( '/favicon.ico' == $_SERVER['REQUEST_URI'] ) { + header('Content-Type: image/vnd.microsoft.icon'); + header('Content-Length: 0'); + exit; + } +} + /** * Dies with a maintenance message when conditions are met. * diff --git a/wp-settings.php b/wp-settings.php index 3ac778abe..71b999eb5 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -43,6 +43,9 @@ wp_fix_server_vars(); // Check for the required PHP version and for the MySQL extension or a database drop-in. wp_check_php_mysql_versions(); +// Check if we have recieved a request due to missing favicon.ico +wp_favicon_request(); + // Check if we're in maintenance mode. wp_maintenance();