Make WordPress Core

Changeset 31939


Ignore:
Timestamp:
03/31/2015 09:17:43 AM (12 years ago)
Author:
pento
Message:

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.

File:
1 edited

Legend:

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

    r31783 r31939  
    28112811                                }
    28122812
    2813                                 return version_compare( $client_version, '5.5.3', '>=' );
     2813                                /*
     2814                                 * libmysql has supported utf8mb4 since 5.5.3, same as the MySQL server.
     2815                                 * mysqlnd has supported utf8mb4 since 5.0.9.
     2816                                 */
     2817                                if ( false !== strpos( $client_version, 'mysqlnd' ) ) {
     2818                                        $client_version = preg_replace( '/^\D+([\d.]+).*/', '$1', $client_version );
     2819                                        return version_compare( $client_version, '5.0.9', '>=' );
     2820                                } else {
     2821                                        return version_compare( $client_version, '5.5.3', '>=' );
     2822                                }
    28142823                }
    28152824
Note: See TracChangeset for help on using the changeset viewer.