From 6621b2ec0e07c0fa4004bb710d5fede850744379 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Wed, 17 Apr 2019 23:03:03 +0000 Subject: [PATCH] Bootstrap/Load: Only send the recovery mode email if the error occurs on a protected endpoint. This reduces the potential email noise to places where the fatal error could be interfering with the login and admin experience. Once the user is in recovery mode, any fatal errors (even if they aren't in a protected endpoint) are handled and the plugin or theme will be paused. Props TimothyBlynJacobs. See #46950. git-svn-id: https://develop.svn.wordpress.org/trunk@45238 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-recovery-mode.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wp-includes/class-wp-recovery-mode.php b/src/wp-includes/class-wp-recovery-mode.php index 6ac1a09569..fc38afdb54 100644 --- a/src/wp-includes/class-wp-recovery-mode.php +++ b/src/wp-includes/class-wp-recovery-mode.php @@ -173,6 +173,10 @@ class WP_Recovery_Mode { } if ( ! $this->is_active() ) { + if ( ! is_protected_endpoint() ) { + return new WP_Error( 'non_protected_endpoint', __( 'Error occurred on a non-protected endpoint.' ) ); + } + if ( ! function_exists( 'wp_generate_password' ) ) { require_once ABSPATH . WPINC . '/pluggable.php'; }