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.
Built from https://develop.svn.wordpress.org/trunk@54239


git-svn-id: http://core.svn.wordpress.org/trunk@53798 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
desrosj 2022-09-20 02:24:12 +00:00
parent 510047a552
commit 0cac41db2e
3 changed files with 3 additions and 3 deletions

View File

@ -236,7 +236,7 @@ class WP_Debug_Data {
} }
// Check WP_ENVIRONMENT_TYPE. // Check WP_ENVIRONMENT_TYPE.
if ( defined( 'WP_ENVIRONMENT_TYPE' ) ) { if ( defined( 'WP_ENVIRONMENT_TYPE' ) && WP_ENVIRONMENT_TYPE ) {
$wp_environment_type = WP_ENVIRONMENT_TYPE; $wp_environment_type = WP_ENVIRONMENT_TYPE;
} else { } else {
$wp_environment_type = __( 'Undefined' ); $wp_environment_type = __( 'Undefined' );

View File

@ -227,7 +227,7 @@ function wp_get_environment_type() {
} }
// Fetch the environment from a constant, this overrides the global system variable. // Fetch the environment from a constant, this overrides the global system variable.
if ( defined( 'WP_ENVIRONMENT_TYPE' ) ) { if ( defined( 'WP_ENVIRONMENT_TYPE' ) && WP_ENVIRONMENT_TYPE ) {
$current_env = WP_ENVIRONMENT_TYPE; $current_env = WP_ENVIRONMENT_TYPE;
} }

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.1-alpha-54238'; $wp_version = '6.1-alpha-54239';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.