Make WordPress Core

Changeset 32233


Ignore:
Timestamp:
04/21/2015 05:23:44 AM (11 years ago)
Author:
pento
Message:

WPDB: When deciding if a query needs extra sanity checking based on collation, we can quickly return if the query is entirely ASCII characters.

See #32029.

Location:
trunk
Files:
2 edited

Legend:

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

    r32232 r32233  
    24062406                }
    24072407
     2408                // All-ASCII queries don't need extra checking.
     2409                if ( $this->check_ascii( $query ) ) {
     2410                        return true;
     2411                }
     2412
    24082413                $table = $this->get_table_from_query( $query );
    24092414                if ( ! $table ) {
  • trunk/tests/phpunit/tests/db/charset.php

    r32232 r32233  
    504504
    505505                        $value[0] = "CREATE TABLE $this_table_name {$value[0]}";
    506                         $value[2] = "SELECT * FROM $this_table_name";
     506                        $value[2] = "SELECT * FROM $this_table_name WHERE a='\xf0\x9f\x98\x88'";
    507507                        $value[3] = "DROP TABLE IF EXISTS $this_table_name";
    508508                        $value[4] = array(
     509                                "SELECT * FROM $this_table_name WHERE a='foo'",
    509510                                "SHOW FULL TABLES LIKE $this_table_name",
    510511                                "DESCRIBE $this_table_name",
Note: See TracChangeset for help on using the changeset viewer.