WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/06/2015 04:50:19 AM (6 years ago)
Author:
pento
Message:

WPDB: If a site is using the utf8 charset, and their version of MySQL supports utf8mb4, auto-upgrade them to utf8mb4.

This patch also resizes some indexes, to allow for the 767 byte index size limit in standard MySQL installs.

See #21212

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/setup-config.php

    r30843 r31349  
    281281                $config_file[ $line_num ] = "define('" . $constant . "'," . $padding . "'" . addcslashes( constant( $constant ), "\\'" ) . "');\r\n";
    282282                break;
     283            case 'DB_CHARSET'  :
     284                if ( 'utf8mb4' === $wpdb->charset || ( ! $wpdb->charset && $wpdb->has_cap( 'utf8mb4' ) ) ) {
     285                    $config_file[ $line_num ] = "define('" . $constant . "'," . $padding . "'utf8mb4');\r\n";
     286                }
     287                break;
    283288            case 'AUTH_KEY'         :
    284289            case 'SECURE_AUTH_KEY'  :
Note: See TracChangeset for help on using the changeset viewer.