WordPress.org

Make WordPress Core

Changeset 31947


Ignore:
Timestamp:
04/01/2015 02:21:15 AM (5 years ago)
Author:
pento
Message:

WPDB: When we check the character set of a column, and find that it's utf8mb4, we should also check that the current connection supports utf8mb4. It's possible that the environment may have changed since upgrading the DB, so we can fall back to utf8 when that happens.

Fixes #31771.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/wp-db.php

    r31939 r31947  
    22202220            if ( ! empty( $column->Collation ) ) {
    22212221                list( $charset ) = explode( '_', $column->Collation );
     2222
     2223                // If the current connection can't support utf8mb4 characters, let's only send 3-byte utf8 characters.
     2224                if ( 'utf8mb4' === $charset && ! $this->has_cap( 'utf8mb4' ) ) {
     2225                    $charset = 'utf8';
     2226                }
     2227
    22222228                $charsets[ strtolower( $charset ) ] = true;
    22232229            }
Note: See TracChangeset for help on using the changeset viewer.