Skip to content

Commit f2f99f3

Browse files
committed
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. git-svn-id: https://develop.svn.wordpress.org/trunk@54239 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 2225a35 commit f2f99f3

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/wp-admin/includes/class-wp-debug-data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public static function debug_data() {
236236
}
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 {
242242
$wp_environment_type = __( 'Undefined' );

src/wp-includes/load.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ function wp_get_environment_type() {
227227
}
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
}
233233

0 commit comments

Comments
 (0)