Make WordPress Core

Changeset 45116

Timestamp:
04/05/2019 03:52:39 PM (5 years ago)
Author:
flixos90
Message:

Bootstrap/Load: Do not redefine constants because tests don't like it.

See #46045.

Location:
trunk/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/plugin.php

    r45115 r45116  
    636636        wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin );
    637637        $_wp_plugin_file = $plugin;
    638         define( 'WP_SANDBOX_SCRAPING', true );
     638        if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) {
     639            define( 'WP_SANDBOX_SCRAPING', true );
     640        }
    639641        include_once( WP_PLUGIN_DIR . '/' . $plugin );
    640642        $plugin = $_wp_plugin_file; // Avoid stomping of the $plugin variable in a plugin.
     
    21332135 */
    21342136function plugin_sandbox_scrape( $plugin ) {
    2135     define( 'WP_SANDBOX_SCRAPING', true );
     2137    if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) {
     2138        define( 'WP_SANDBOX_SCRAPING', true );
     2139    }
    21362140    wp_register_plugin_realpath( WP_PLUGIN_DIR . '/' . $plugin );
    21372141    include( WP_PLUGIN_DIR . '/' . $plugin );
  • trunk/src/wp-admin/includes/theme.php

    r45114 r45116  
    860860            // Load the theme's functions.php to test whether it throws a fatal error.
    861861            ob_start();
    862             define( 'WP_SANDBOX_SCRAPING', true );
     862            if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) {
     863                define( 'WP_SANDBOX_SCRAPING', true );
     864            }
    863865            include $functions_path;
    864866            ob_clean();
  • trunk/src/wp-includes/load.php

    r45114 r45116  
    14451445        die();
    14461446    }
    1447     define( 'WP_SANDBOX_SCRAPING', true );
     1447    if ( ! defined( 'WP_SANDBOX_SCRAPING' ) ) {
     1448        define( 'WP_SANDBOX_SCRAPING', true );
     1449    }
    14481450    register_shutdown_function( 'wp_finalize_scraping_edited_file_errors', $key );
    14491451}
Note: See TracChangeset for help on using the changeset viewer.