WordPress.org

Make WordPress Core

Changeset 31093


Ignore:
Timestamp:
01/08/2015 08:31:42 AM (5 years ago)
Author:
pento
Message:

WPDB: When wpdb::query() needs to sanity check a query string, make sure to run wpdb:flush() afterwards, to ensure the results from sanity check queries aren't mixed up with the results for the user query.

See #21212.

Fixes #30948.

File:
1 edited

Legend:

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

    r31090 r31093  
    16011601        if ( $this->check_current_query && ! $this->check_ascii( $query ) ) {
    16021602            $stripped_query = $this->strip_invalid_text_from_query( $query );
     1603            // strip_invalid_text_from_query() can perform queries, so we need
     1604            // to flush again, just to make sure everything is clear.
     1605            $this->flush();
    16031606            if ( $stripped_query !== $query ) {
    16041607                $this->insert_id = 0;
Note: See TracChangeset for help on using the changeset viewer.