From ff53498be87d63a28e1ce87f73b9dcabda49d196 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Thu, 2 May 2019 10:52:10 +0000 Subject: [PATCH] Bootstrap/Load: Ensure recovery link email and related notices are properly translated. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When recovery mode is triggered before the site’s locale has been initialized, the message displayed to the user and the email sent to the site administrator with the recovery mode link are always rendered in `en_US`. This change ensures the site’s locale is used even when an error happens early in the loading process. Reviewed by swissspidy, SergeyBiryukov, and desrosj. Props wolly, TimothyBlynJacobs, fierevere. Fixes #47093. git-svn-id: https://develop.svn.wordpress.org/trunk@45277 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-fatal-error-handler.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wp-includes/class-wp-fatal-error-handler.php b/src/wp-includes/class-wp-fatal-error-handler.php index 458f674104..96958d10de 100644 --- a/src/wp-includes/class-wp-fatal-error-handler.php +++ b/src/wp-includes/class-wp-fatal-error-handler.php @@ -37,6 +37,10 @@ class WP_Fatal_Error_Handler { return; } + if ( ! isset( $GLOBALS['wp_locale'] ) ) { + load_default_textdomain(); + } + if ( ! is_multisite() && wp_recovery_mode()->is_initialized() ) { wp_recovery_mode()->handle_error( $error ); }