WPDB: When we're checking to see if the MySQL client library supports `utf8mb4`, we need a separate check for `mysqlnd` versions, which using different version numbering to `libmysqlclient`.

Props MattyRob.

Fixes #31644.


Built from https://develop.svn.wordpress.org/trunk@31939


git-svn-id: http://core.svn.wordpress.org/trunk@31918 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2015-03-31 09:18:27 +00:00
parent 486e80bdf5
commit 2a8a5c963a
2 changed files with 11 additions and 2 deletions

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.2-beta3-31938';
$wp_version = '4.2-beta3-31939';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -2810,7 +2810,16 @@ class wpdb {
$client_version = mysql_get_client_info();
}
return version_compare( $client_version, '5.5.3', '>=' );
/*
* libmysql has supported utf8mb4 since 5.5.3, same as the MySQL server.
* mysqlnd has supported utf8mb4 since 5.0.9.
*/
if ( false !== strpos( $client_version, 'mysqlnd' ) ) {
$client_version = preg_replace( '/^\D+([\d.]+).*/', '$1', $client_version );
return version_compare( $client_version, '5.0.9', '>=' );
} else {
return version_compare( $client_version, '5.5.3', '>=' );
}
}
return false;