From 54b4f3aa8ed5d6994bd0aaec68bd811d52c47407 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Thu, 26 Jan 2023 00:07:14 +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. Built from https://develop.svn.wordpress.org/trunk@55143 git-svn-id: http://core.svn.wordpress.org/trunk@54676 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/version.php | 2 +- wp-settings.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/version.php b/wp-includes/version.php index d0d09400ad0f..e621a5a996fc 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-alpha-55142'; +$wp_version = '6.2-alpha-55143'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-settings.php b/wp-settings.php index 3ed93b2f3662..80593fa3f820 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -434,7 +434,7 @@ // 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(); }