diff --git a/src/wp-admin/includes/plugin.php b/src/wp-admin/includes/plugin.php
index 54c6db27ac..a6220466a4 100644
a
|
b
|
function wp_clean_plugins_cache( $clear_update_cache = true ) { |
2125 | 2125 | * @param string $plugin Path to the plugin file relative to the plugins directory. |
2126 | 2126 | */ |
2127 | 2127 | function plugin_sandbox_scrape( $plugin ) { |
| 2128 | define( 'WP_SANDBOX_SCRAPING', true ); |
2128 | 2129 | wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin ); |
2129 | 2130 | include( WP_PLUGIN_DIR . '/' . $plugin ); |
2130 | 2131 | } |
diff --git a/src/wp-admin/includes/theme.php b/src/wp-admin/includes/theme.php
index 1ab7959e5f..98391123aa 100644
a
|
b
|
function resume_theme( $theme, $redirect = '' ) { |
859 | 859 | |
860 | 860 | // Load the theme's functions.php to test whether it throws a fatal error. |
861 | 861 | ob_start(); |
| 862 | define( 'WP_SANDBOX_SCRAPING', true ); |
862 | 863 | include $functions_path; |
863 | 864 | ob_clean(); |
864 | 865 | } |
diff --git a/src/wp-includes/class-wp-fatal-error-handler.php b/src/wp-includes/class-wp-fatal-error-handler.php
index 8ec87c9e24..270bb9e444 100644
a
|
b
|
class WP_Fatal_Error_Handler { |
26 | 26 | * @since 5.2.0 |
27 | 27 | */ |
28 | 28 | public function handle() { |
| 29 | if ( defined( 'WP_SANDBOX_SCRAPING' ) && WP_SANDBOX_SCRAPING ) { |
| 30 | return; |
| 31 | } |
| 32 | |
29 | 33 | try { |
30 | 34 | // Bail if no error found. |
31 | 35 | $error = $this->detect_error(); |
diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php
index f2c9318da6..1915fbde17 100644
a
|
b
|
function wp_start_scraping_edited_file_errors() { |
1444 | 1444 | echo "###### wp_scraping_result_end:$key ######"; |
1445 | 1445 | die(); |
1446 | 1446 | } |
| 1447 | define( 'WP_SANDBOX_SCRAPING', true ); |
1447 | 1448 | register_shutdown_function( 'wp_finalize_scraping_edited_file_errors', $key ); |
1448 | 1449 | } |
1449 | 1450 | |