Make WordPress Core

Changeset 54239


Ignore:
Timestamp:
09/20/2022 02:22:49 AM (2 years ago)
Author:
desrosj
Message:

Bootstrap/Load: Confirm the value of WP_ENVIRONMENT_TYPE before using.

This adjusts the check for the presence of the WP_ENVIRONMENT_TYPE constant to also confirm it is set to a non-empty value before using.

Props dd32, khokansardar, ramon-fincken.
Fixes #55741.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-debug-data.php

    r54133 r54239  
    237237
    238238        // Check WP_ENVIRONMENT_TYPE.
    239         if ( defined( 'WP_ENVIRONMENT_TYPE' ) ) {
     239        if ( defined( 'WP_ENVIRONMENT_TYPE' ) && WP_ENVIRONMENT_TYPE ) {
    240240            $wp_environment_type = WP_ENVIRONMENT_TYPE;
    241241        } else {
  • trunk/src/wp-includes/load.php

    r54080 r54239  
    228228
    229229    // Fetch the environment from a constant, this overrides the global system variable.
    230     if ( defined( 'WP_ENVIRONMENT_TYPE' ) ) {
     230    if ( defined( 'WP_ENVIRONMENT_TYPE' ) && WP_ENVIRONMENT_TYPE ) {
    231231        $current_env = WP_ENVIRONMENT_TYPE;
    232232    }
Note: See TracChangeset for help on using the changeset viewer.