Changeset 37521
- Timestamp:
- 05/23/2016 05:53:02 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/wp-db.php
r37518 r37521 758 758 } 759 759 760 if ( 'utf8mb4' === $this->charset && ( ! $this->collate || stripos( $this->collate, 'utf8_' ) === 0 ) ) { 761 $this->collate = 'utf8mb4_unicode_ci'; 760 if ( 'utf8mb4' === $this->charset ) { 761 // _general_ is outdated, so we can upgrade it to _unicode_, instead. 762 if ( ! $this->collate || 'utf8_general_ci' === $this->collate ) { 763 $this->collate = 'utf8mb4_unicode_ci'; 764 } else { 765 $this->collate = str_replace( 'utf8_', 'utf8mb4_', $this->collate ); 766 } 762 767 } 763 768 } -
trunk/tests/phpunit/tests/db.php
r36997 r37521 956 956 $wpdb->check_connection(); 957 957 } 958 959 /** 960 * @ticket 32405 961 */ 962 function test_non_unicode_collations() { 963 global $wpdb; 964 965 if ( ! $wpdb->has_cap( 'utf8mb4' ) ) { 966 $this->markTestSkipped( 'This test requires utf8mb4 support' ); 967 } 968 969 $charset = $wpdb->charset; 970 $collate = $wpdb->collate; 971 972 $wpdb->init_charset( 'utf8', 'utf8_swedish_ci' ); 973 974 $this->assertSame( 'utf8mb4', $wpdb->charset ); 975 $this->assertSame( 'utf8mb4_swedish_ci', $wpdb->collate ); 976 977 $wpdb->init_charset( $charset, $collate ); 978 } 958 979 }
Note: See TracChangeset
for help on using the changeset viewer.