From bce22ebbf8ea00ee7759af30663986058c4e3421 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Thu, 26 Jan 2023 00:05:05 +0000 Subject: [PATCH] Bootstrap/Load: Avoid initializing `WP_Recovery_Mode` when fatal error handler is disabled. The WordPress recovery mode only works in combination with the fatal error handler that works as the entry mode for recovery mode. The fatal error handler can be disabled using the `WP_DISABLE_FATAL_ERROR_HANDLER` constant, but so far the logic in the `WP_Recovery_Mode` class was still being initialized even when that constant was set to `true`, which is unnecessary. This changeset updates the WordPress bootstrap process to only initialize `WP_Recovery_Mode` when needed. Props costdev. Fixes #56848. git-svn-id: https://develop.svn.wordpress.org/trunk@55143 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-settings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-settings.php b/src/wp-settings.php index 3ed93b2f36..80593fa3f8 100644 --- a/src/wp-settings.php +++ b/src/wp-settings.php @@ -434,7 +434,7 @@ wp_start_scraping_edited_file_errors(); // Register the default theme directory root. register_theme_directory( get_theme_root() ); -if ( ! is_multisite() ) { +if ( ! is_multisite() && wp_is_fatal_error_handler_enabled() ) { // Handle users requesting a recovery mode link and initiating recovery mode. wp_recovery_mode()->initialize(); }