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. git-svn-id: https://develop.svn.wordpress.org/trunk@32233 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0fe5a64e56
commit
afe046a84c
@ -2405,6 +2405,11 @@ class wpdb {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// All-ASCII queries don't need extra checking.
|
||||||
|
if ( $this->check_ascii( $query ) ) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
$table = $this->get_table_from_query( $query );
|
$table = $this->get_table_from_query( $query );
|
||||||
if ( ! $table ) {
|
if ( ! $table ) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -503,9 +503,10 @@ class Tests_DB_Charset extends WP_UnitTestCase {
|
|||||||
$this_table_name = $table_name . '_' . rand_str( 5 );
|
$this_table_name = $table_name . '_' . rand_str( 5 );
|
||||||
|
|
||||||
$value[0] = "CREATE TABLE $this_table_name {$value[0]}";
|
$value[0] = "CREATE TABLE $this_table_name {$value[0]}";
|
||||||
$value[2] = "SELECT * FROM $this_table_name";
|
$value[2] = "SELECT * FROM $this_table_name WHERE a='\xf0\x9f\x98\x88'";
|
||||||
$value[3] = "DROP TABLE IF EXISTS $this_table_name";
|
$value[3] = "DROP TABLE IF EXISTS $this_table_name";
|
||||||
$value[4] = array(
|
$value[4] = array(
|
||||||
|
"SELECT * FROM $this_table_name WHERE a='foo'",
|
||||||
"SHOW FULL TABLES LIKE $this_table_name",
|
"SHOW FULL TABLES LIKE $this_table_name",
|
||||||
"DESCRIBE $this_table_name",
|
"DESCRIBE $this_table_name",
|
||||||
"DESC $this_table_name",
|
"DESC $this_table_name",
|
||||||
|
Loading…
Reference in New Issue
Block a user