Make WordPress Core


Ignore:
Timestamp:
05/06/2015 06:04:50 AM (9 years ago)
Author:
pento
Message:

WPDB: When sanity checking query character sets, there's no need to check queries that don't return user data.

See #32104.

File:
1 edited

Legend:

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

    r32368 r32374  
    25322532        // We don't need to check the collation for queries that don't read data.
    25332533        $query = ltrim( $query, "\r\n\t (" );
    2534         if ( preg_match( '/^(?:SHOW|DESCRIBE|DESC|EXPLAIN)\s/i', $query ) ) {
     2534        if ( preg_match( '/^(?:SHOW|DESCRIBE|DESC|EXPLAIN|CREATE)\s/i', $query ) ) {
    25352535            return true;
    25362536        }
     
    27422742     */
    27432743    protected function strip_invalid_text_from_query( $query ) {
     2744        // We don't need to check the collation for queries that don't read data.
     2745        $trimmed_query = ltrim( $query, "\r\n\t (" );
     2746        if ( preg_match( '/^(?:SHOW|DESCRIBE|DESC|EXPLAIN|CREATE)\s/i', $trimmed_query ) ) {
     2747            return $query;
     2748        }
     2749
    27442750        $table = $this->get_table_from_query( $query );
    27452751        if ( $table ) {
Note: See TracChangeset for help on using the changeset viewer.