Ticket #32136: 32136.diff
File 32136.diff, 998 bytes (added by , 9 years ago) |
---|
-
src/wp-includes/wp-db.php
2590 2590 protected function strip_invalid_text( $data ) { 2591 2591 $db_check_string = false; 2592 2592 2593 $internal_encoding = false; 2594 if ( function_exists( 'mb_internal_encoding' ) ) { 2595 $internal_encoding = mb_internal_encoding(); 2596 } 2597 2593 2598 foreach ( $data as &$value ) { 2594 2599 $charset = $value['charset']; 2595 2600 … … 2636 2641 } 2637 2642 2638 2643 // utf8 can be handled by regex, which is a bunch faster than a DB lookup. 2639 if ( ( 'utf8' === $charset || 'utf8mb3' === $charset || 'utf8mb4' === $charset ) && function_exists( 'mb_strlen' ) ) {2644 if ( ( 'utf8' === $charset || 'utf8mb3' === $charset || 'utf8mb4' === $charset ) && 'UTF-8' === $internal_encoding && function_exists( 'mb_strlen' ) ) { 2640 2645 $regex = '/ 2641 2646 ( 2642 2647 (?: [\x00-\x7F] # single-byte sequences 0xxxxxxx