From aea1ccbab45865a3ba5433f0d8d6496d16ff7c5e Mon Sep 17 00:00:00 2001 From: Aaron Jorbin Date: Sat, 5 Jun 2021 15:45:10 +0000 Subject: [PATCH] Booststrap/Load: Only reference recovery mode email when it can be sent. The recovery mode email is sent from within the WP_Recovery_Mode::handle_error() method, but that method is only called by the fatal error handler if WP_Recovery_Mode has been initialized. This adjusts the message to only say the email has been sent if it can be sent. Props reynhartono, stevegrunwell for initial plan. Fixes #52560. git-svn-id: https://develop.svn.wordpress.org/trunk@51076 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-fatal-error-handler.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wp-includes/class-wp-fatal-error-handler.php b/src/wp-includes/class-wp-fatal-error-handler.php index 412e1299f4..5a24793124 100644 --- a/src/wp-includes/class-wp-fatal-error-handler.php +++ b/src/wp-includes/class-wp-fatal-error-handler.php @@ -182,7 +182,7 @@ class WP_Fatal_Error_Handler { if ( true === $handled && wp_is_recovery_mode() ) { $message = __( 'There has been a critical error on this website, putting it in recovery mode. Please check the Themes and Plugins screens for more details. If you just installed or updated a theme or plugin, check the relevant page for that first.' ); - } elseif ( is_protected_endpoint() ) { + } elseif ( is_protected_endpoint() && wp_recovery_mode()->is_initialized() ) { $message = __( 'There has been a critical error on this website. Please check your site admin email inbox for instructions.' ); } else { $message = __( 'There has been a critical error on this website.' );