Make WordPress Core

Ticket #32051: 32051.diff

File 32051.diff, 1.4 KB (added by pento, 10 years ago)
  • src/wp-includes/wp-db.php

     
    25342534
    25352535                if ( $db_check_string ) {
    25362536                        $queries = array();
    2537                         foreach ( $data as $col => $value ) {
     2537                        foreach ( $data as $col => &$value ) {
    25382538                                if ( ! empty( $value['db'] ) ) {
    25392539                                        if ( ! isset( $queries[ $value['charset'] ] ) ) {
    25402540                                                $queries[ $value['charset'] ] = array();
     
    25422542
    25432543                                        // Split the CONVERT() calls by charset, so we can make sure the connection is right
    25442544                                        $queries[ $value['charset'] ][ $col ] = $this->prepare( "CONVERT( %s USING {$value['charset']} )", $value['value'] );
     2545                                        unset( $value['db'] );
    25452546                                }
    25462547                        }
    25472548
  • tests/phpunit/tests/db/charset.php

     
    5959                                'charset'  => 'koi8r',
    6060                                'value'    => "\xfdord\xf2ress",
    6161                                'expected' => "\xfdord\xf2ress",
    62                                 'db'       => true
    6362                        ),
    6463                        'hebrew' => array(
    6564                                // hebrew needs to be checked in MySQL, too
     
    6665                                'charset'  => 'hebrew',
    6766                                'value'    => "\xf9ord\xf7ress",
    6867                                'expected' => "\xf9ord\xf7ress",
    69                                 'db'       => true
    7068                        ),
    7169                        'false' => array(
    7270                                // false is a column with no character set (ie, a number column)