mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@31947 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2219,6 +2219,12 @@ class wpdb {
|
||||
foreach ( $columns as $column ) {
|
||||
if ( ! empty( $column->Collation ) ) {
|
||||
list( $charset ) = explode( '_', $column->Collation );
|
||||
|
||||
// If the current connection can't support utf8mb4 characters, let's only send 3-byte utf8 characters.
|
||||
if ( 'utf8mb4' === $charset && ! $this->has_cap( 'utf8mb4' ) ) {
|
||||
$charset = 'utf8';
|
||||
}
|
||||
|
||||
$charsets[ strtolower( $charset ) ] = true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user