Make WordPress Core

Ticket #32136: 32136.diff

File 32136.diff, 998 bytes (added by pento, 10 years ago)
  • src/wp-includes/wp-db.php

     
    25902590        protected function strip_invalid_text( $data ) {
    25912591                $db_check_string = false;
    25922592
     2593                $internal_encoding = false;
     2594                if ( function_exists( 'mb_internal_encoding' ) ) {
     2595                        $internal_encoding = mb_internal_encoding();
     2596                }
     2597
    25932598                foreach ( $data as &$value ) {
    25942599                        $charset = $value['charset'];
    25952600
     
    26362641                        }
    26372642
    26382643                        // 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' ) ) {
    26402645                                $regex = '/
    26412646                                        (
    26422647                                                (?: [\x00-\x7F]                  # single-byte sequences   0xxxxxxx