diff --git a/src/wp-includes/class-wpdb.php b/src/wp-includes/class-wpdb.php index e9d7f986d5801..d6fd275690a89 100644 --- a/src/wp-includes/class-wpdb.php +++ b/src/wp-includes/class-wpdb.php @@ -1166,11 +1166,29 @@ public function tables( $scope = 'all', $prefix = true, $blog_id = 0 ) { } if ( isset( $tables['users'] ) && defined( 'CUSTOM_USER_TABLE' ) ) { - $tables['users'] = CUSTOM_USER_TABLE; + if( ! is_string( 'CUSTOM_USER_TABLE' ) || !CUSTOM_USER_TABLE ) { + wp_load_translations_early(); + _doing_it_wrong( + 'wpdb::tables', + __( 'The defined value for CUSTOM_USER_TABLE is not a string or is an empty string.' ), + '7.0.3' + ); + } else { + $tables['users'] = CUSTOM_USER_TABLE; + } } if ( isset( $tables['usermeta'] ) && defined( 'CUSTOM_USER_META_TABLE' ) ) { - $tables['usermeta'] = CUSTOM_USER_META_TABLE; + if( ! is_string( 'CUSTOM_USER_META_TABLE' ) || !CUSTOM_USER_META_TABLE ) { + wp_load_translations_early(); + _doing_it_wrong( + 'wpdb::tables', + __( 'The defined value for CUSTOM_USER_META_TABLE is not a string or is an empty string.' ), + '7.0.3' + ); + } else { + $tables['usermeta'] = CUSTOM_USER_META_TABLE; + } } }