Make WordPress Core

Changeset 32275


Ignore:
Timestamp:
04/23/2015 11:55:46 AM (9 years ago)
Author:
pento
Message:

WPDB: When sanity checking a string by sending it to MySQL for conversion checks, the incorrect data structure was being returned from wpdb::strip_invalid_text(), causing all write queries to fail for some character sets when the query contained non-ASCII characters.

Merge of [32261] to the 3.7 branch.

See #32051.

Location:
branches/3.7
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.7/src/wp-includes/wp-db.php

    r32241 r32275  
    20962096                    // Split the CONVERT() calls by charset, so we can make sure the connection is right
    20972097                    $queries[ $value['charset'] ][ $col ] = $this->prepare( "CONVERT( %s USING {$value['charset']} )", $value['value'] );
     2098                    unset( $data[ $col ]['db'] );
    20982099                }
    20992100            }
  • branches/3.7/tests/phpunit/tests/db/charset.php

    r32241 r32275  
    5656            ),
    5757            'koi8r' => array(
    58                 // koi8r is a character set that needs to be checked in MySQL
    5958                'charset'  => 'koi8r',
    6059                'value'    => "\xfdord\xf2ress",
    6160                'expected' => "\xfdord\xf2ress",
    62                 'db'       => true
    6361            ),
    6462            'hebrew' => array(
    65                 // hebrew needs to be checked in MySQL, too
    6663                'charset'  => 'hebrew',
    6764                'value'    => "\xf9ord\xf7ress",
    6865                'expected' => "\xf9ord\xf7ress",
    69                 'db'       => true
     66            ),
     67            'cp1251' => array(
     68                'charset'  => 'cp1251',
     69                'value'    => "\xd8ord\xd0ress",
     70                'expected' => "\xd8ord\xd0ress",
     71            ),
     72            'tis620' => array(
     73                'charset'  => 'tis620',
     74                'value'    => "\xccord\xe3ress",
     75                'expected' => "\xccord\xe3ress",
    7076            ),
    7177            'false' => array(
Note: See TracChangeset for help on using the changeset viewer.