Skip to content

Commit

Permalink
Bootstrap/Load: Avoid initializing WP_Recovery_Mode when fatal erro…
Browse files Browse the repository at this point in the history
…r 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
  • Loading branch information
Felix Arntz committed Jan 26, 2023
1 parent d0e699b commit 54b4f3a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion wp-includes/version.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion wp-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 54b4f3a

Please sign in to comment.