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.



git-svn-id: https://develop.svn.wordpress.org/trunk@31939 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2015-03-31 09:17:43 +00:00
parent 48e551feb5
commit 67ae889160
1 changed files with 10 additions and 1 deletions

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;