From 9171d921f4ca0efb50d449254318eaf3e8ab2328 Mon Sep 17 00:00:00 2001 From: Aaron Jorbin Date: Tue, 1 Oct 2024 01:12:17 +0000 Subject: [PATCH] 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 --- wp-admin/includes/class-wp-debug-data.php | 13 +++++++++++-- wp-includes/version.php | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/wp-admin/includes/class-wp-debug-data.php b/wp-admin/includes/class-wp-debug-data.php index ba6d10ea32..273ab52c51 100644 --- a/wp-admin/includes/class-wp-debug-data.php +++ b/wp-admin/includes/class-wp-debug-data.php @@ -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, ), ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 75924f8a9c..e07d059bc6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -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.