Make WordPress Core

Changeset 59147


Ignore:
Timestamp:
10/01/2024 01:10:38 AM (6 weeks ago)
Author:
jorbin
Message:

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.

File:
1 edited

Legend:

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

    r59104 r59147  
    13391339        }
    13401340
     1341        // Check DB_COLLATE.
     1342        if ( defined( 'DB_COLLATE' ) && DB_COLLATE ) {
     1343            $wp_db_collate = DB_COLLATE;
     1344        } elseif ( defined( 'DB_COLLATE' ) && empty( DB_COLLATE ) ) {
     1345            $wp_db_collate = __( 'Defined, but empty' );
     1346        } else {
     1347            $wp_db_collate = __( 'Undefined' );
     1348        }
     1349
    13411350        $fields = array(
    13421351            'ABSPATH'             => array(
     
    14281437            'DB_COLLATE'          => array(
    14291438                'label' => 'DB_COLLATE',
    1430                 'value' => ( defined( 'DB_COLLATE' ) ? DB_COLLATE : __( 'Undefined' ) ),
    1431                 'debug' => ( defined( 'DB_COLLATE' ) ? DB_COLLATE : 'undefined' ),
     1439                'value' => $wp_db_collate,
     1440                'debug' => $wp_db_collate,
    14321441            ),
    14331442        );
Note: See TracChangeset for help on using the changeset viewer.