From 4254a35ad82996e9e866b8e771f955235fb6205a Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Mon, 28 Jan 2019 17:42:55 +0000 Subject: [PATCH] Bootstrap/Load: Fix notice when theme directories are not populated yet. When a fatal error occurs outside of a regular plugin in a stage where theme directories are not set up yet (for example in a MU plugin), this would previously trigger a notice. Props johnbillion. Fixes #46068. See #44458. git-svn-id: https://develop.svn.wordpress.org/trunk@44706 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/error-protection.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wp-includes/error-protection.php b/src/wp-includes/error-protection.php index 45fba0cc33..c9b5740960 100644 --- a/src/wp-includes/error-protection.php +++ b/src/wp-includes/error-protection.php @@ -68,6 +68,10 @@ function wp_record_extension_error( $error ) { $callback = 'wp_paused_plugins'; $path = str_replace( $wp_plugin_dir . '/', '', $error_file ); } else { + if ( empty( $wp_theme_directories ) ) { + return false; + } + foreach ( $wp_theme_directories as $theme_directory ) { $theme_directory = wp_normalize_path( $theme_directory ); if ( 0 === strpos( $error_file, $theme_directory ) ) {