mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-02 05:31:25 +01:00
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. Built from https://develop.svn.wordpress.org/trunk@31093 git-svn-id: http://core.svn.wordpress.org/trunk@31074 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
ac6fddee35
commit
83a229084f
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '4.2-alpha-31092';
|
$wp_version = '4.2-alpha-31093';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
@ -1600,6 +1600,9 @@ class wpdb {
|
|||||||
// If we're writing to the database, make sure the query will write safely.
|
// If we're writing to the database, make sure the query will write safely.
|
||||||
if ( $this->check_current_query && ! $this->check_ascii( $query ) ) {
|
if ( $this->check_current_query && ! $this->check_ascii( $query ) ) {
|
||||||
$stripped_query = $this->strip_invalid_text_from_query( $query );
|
$stripped_query = $this->strip_invalid_text_from_query( $query );
|
||||||
|
// strip_invalid_text_from_query() can perform queries, so we need
|
||||||
|
// to flush again, just to make sure everything is clear.
|
||||||
|
$this->flush();
|
||||||
if ( $stripped_query !== $query ) {
|
if ( $stripped_query !== $query ) {
|
||||||
$this->insert_id = 0;
|
$this->insert_id = 0;
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user