mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-03-31 10:44:26 +00:00
WPDB: When sanity checking query character sets, there's no need to check queries that don't return user data.
See #32104. git-svn-id: https://develop.svn.wordpress.org/trunk@32374 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -642,6 +642,38 @@ class Tests_DB_Charset extends WP_UnitTestCase {
|
||||
self::$_wpdb->query( $drop );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 32104
|
||||
*/
|
||||
function data_dont_strip_text_from_schema_queries() {
|
||||
// An obviously invalid and fake table name.
|
||||
$table_name = "\xff\xff\xff\xff";
|
||||
|
||||
$queries = array(
|
||||
"SHOW CREATE TABLE $table_name",
|
||||
"DESCRIBE $table_name",
|
||||
"DESC $table_name",
|
||||
"EXPLAIN SELECT * FROM $table_name",
|
||||
"CREATE $table_name( a VARCHAR(100))",
|
||||
);
|
||||
|
||||
foreach ( $queries as &$query ) {
|
||||
$query = array( $query );
|
||||
}
|
||||
unset( $query );
|
||||
|
||||
return $queries;
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider data_dont_strip_text_from_schema_queries
|
||||
* @ticket 32104
|
||||
*/
|
||||
function test_dont_strip_text_from_schema_queries( $query ) {
|
||||
$return = self::$_wpdb->strip_invalid_text_from_query( $query );
|
||||
$this->assertEquals( $query, $return );
|
||||
}
|
||||
|
||||
/**
|
||||
* @ticket 21212
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user