Changeset 32235
- Timestamp:
- 04/21/2015 06:18:58 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/4.0/src/wp-includes/wp-db.php
r32225 r32235 2372 2372 return true; 2373 2373 } 2374 2375 // We don't need to check the collation for queries that don't read data. 2376 $query = ltrim( $query, "\r\n\t (" ); 2377 if ( preg_match( '/^(?:SHOW|DESCRIBE|DESC|EXPLAIN)\s/i', $query ) ) { 2378 return true; 2379 } 2380 2381 // All-ASCII queries don't need extra checking. 2382 if ( $this->check_ascii( $query ) ) { 2383 return true; 2384 } 2385 2374 2386 $table = $this->get_table_from_query( $query ); 2375 2387 if ( ! $table ) { … … 2378 2390 2379 2391 $this->checking_collation = true; 2380 $ this->get_table_charset( $table );2392 $collation = $this->get_table_charset( $table ); 2381 2393 $this->checking_collation = false; 2394 2395 // Tables with no collation, or latin1 only, don't need extra checking. 2396 if ( false === $collation || 'latin1' === $collation ) { 2397 return true; 2398 } 2382 2399 2383 2400 $table = strtolower( $table ); … … 2386 2403 } 2387 2404 2405 // If any of the columns don't have one of these collations, it needs more sanity checking. 2388 2406 foreach( $this->col_meta[ $table ] as $col ) { 2389 2407 if ( empty( $col->Collation ) ) { … … 2413 2431 * remove invalid characters, a {@see WP_Error} object is returned. 2414 2432 */ 2433 // If any of the columns don't have one of these collations, it needs more sanity checking. 2415 2434 protected function strip_invalid_text( $data ) { 2416 2435 // Some multibyte character sets that we can check in PHP.
Note: See TracChangeset
for help on using the changeset viewer.