From 52354f3f0b7f2b6e53d6ca3578942d5940f84048 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Fri, 5 Apr 2019 15:53:50 +0000 Subject: [PATCH] Bootstrap/Load: Do not redefine constants because tests don't like it. See #46045. Built from https://develop.svn.wordpress.org/trunk@45116 git-svn-id: http://core.svn.wordpress.org/trunk@44925 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/plugin.php | 8 ++++++-- wp-admin/includes/theme.php | 4 +++- wp-includes/load.php | 4 +++- wp-includes/version.php | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/wp-admin/includes/plugin.php b/wp-admin/includes/plugin.php index f8ca6ea5fd..b8dcdbe53b 100644 --- a/wp-admin/includes/plugin.php +++ b/wp-admin/includes/plugin.php @@ -635,7 +635,9 @@ function activate_plugin( $plugin, $redirect = '', $network_wide = false, $silen ob_start(); wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin ); $_wp_plugin_file = $plugin; - define( 'WP_SANDBOX_SCRAPING', true ); + if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) { + define( 'WP_SANDBOX_SCRAPING', true ); + } include_once( WP_PLUGIN_DIR . '/' . $plugin ); $plugin = $_wp_plugin_file; // Avoid stomping of the $plugin variable in a plugin. @@ -2132,7 +2134,9 @@ function wp_clean_plugins_cache( $clear_update_cache = true ) { * @param string $plugin Path to the plugin file relative to the plugins directory. */ function plugin_sandbox_scrape( $plugin ) { - define( 'WP_SANDBOX_SCRAPING', true ); + if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) { + define( 'WP_SANDBOX_SCRAPING', true ); + } wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin ); include( WP_PLUGIN_DIR . '/' . $plugin ); } diff --git a/wp-admin/includes/theme.php b/wp-admin/includes/theme.php index 98391123aa..5283cea8bc 100644 --- a/wp-admin/includes/theme.php +++ b/wp-admin/includes/theme.php @@ -859,7 +859,9 @@ function resume_theme( $theme, $redirect = '' ) { // Load the theme's functions.php to test whether it throws a fatal error. ob_start(); - define( 'WP_SANDBOX_SCRAPING', true ); + if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) { + define( 'WP_SANDBOX_SCRAPING', true ); + } include $functions_path; ob_clean(); } diff --git a/wp-includes/load.php b/wp-includes/load.php index 1915fbde17..05d37f5a79 100644 --- a/wp-includes/load.php +++ b/wp-includes/load.php @@ -1444,7 +1444,9 @@ function wp_start_scraping_edited_file_errors() { echo "###### wp_scraping_result_end:$key ######"; die(); } - define( 'WP_SANDBOX_SCRAPING', true ); + if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) { + define( 'WP_SANDBOX_SCRAPING', true ); + } register_shutdown_function( 'wp_finalize_scraping_edited_file_errors', $key ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index 2d72821b74..5615da0c2b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.2-beta1-45115'; +$wp_version = '5.2-beta1-45116'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.