Site Health: Note when DB_COLLATE is defined but empty.

Right now, for example if DB_COLLATE is defined as '', the value will not be shown in the WordPress Constants list, there's just an empty space. This adds a message so it's clearer when the constant is empty.

Props Presskopp, brobken, Clorith.
Fixes #58265.

Built from https://develop.svn.wordpress.org/trunk@59147


git-svn-id: http://core.svn.wordpress.org/trunk@58543 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Aaron Jorbin 2024-10-01 01:12:17 +00:00
parent 6c1b7e5db8
commit 9171d921f4
2 changed files with 12 additions and 3 deletions

View File

@ -1338,6 +1338,15 @@ class WP_Debug_Data {
$wp_environment_type = __( 'Undefined' );
}
// Check DB_COLLATE.
if ( defined( 'DB_COLLATE' ) && DB_COLLATE ) {
$wp_db_collate = DB_COLLATE;
} elseif ( defined( 'DB_COLLATE' ) && empty( DB_COLLATE ) ) {
$wp_db_collate = __( 'Defined, but empty' );
} else {
$wp_db_collate = __( 'Undefined' );
}
$fields = array(
'ABSPATH' => array(
'label' => 'ABSPATH',
@ -1427,8 +1436,8 @@ class WP_Debug_Data {
),
'DB_COLLATE' => array(
'label' => 'DB_COLLATE',
'value' => ( defined( 'DB_COLLATE' ) ? DB_COLLATE : __( 'Undefined' ) ),
'debug' => ( defined( 'DB_COLLATE' ) ? DB_COLLATE : 'undefined' ),
'value' => $wp_db_collate,
'debug' => $wp_db_collate,
),
);

View File

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