mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-30 20:21:37 +01:00
WPDB: To ensure we're not asking MySQL to read data using queries that it can't handle, make sure that we run all read queries through the character set sanity checks.
See #21212. Built from https://develop.svn.wordpress.org/trunk@31051 git-svn-id: http://core.svn.wordpress.org/trunk@31032 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
9704ee2a5c
commit
0e806f1695
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.2-alpha-31050';
|
||||
$wp_version = '4.2-alpha-31051';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
@ -2017,7 +2017,6 @@ class wpdb {
|
||||
$this->func_call = "\$db->get_var(\"$query\", $x, $y)";
|
||||
|
||||
if ( $query ) {
|
||||
$this->check_current_query = false;
|
||||
$this->query( $query );
|
||||
}
|
||||
|
||||
@ -2046,7 +2045,6 @@ class wpdb {
|
||||
public function get_row( $query = null, $output = OBJECT, $y = 0 ) {
|
||||
$this->func_call = "\$db->get_row(\"$query\",$output,$y)";
|
||||
if ( $query ) {
|
||||
$this->check_current_query = false;
|
||||
$this->query( $query );
|
||||
} else {
|
||||
return null;
|
||||
@ -2084,7 +2082,6 @@ class wpdb {
|
||||
*/
|
||||
public function get_col( $query = null , $x = 0 ) {
|
||||
if ( $query ) {
|
||||
$this->check_current_query = false;
|
||||
$this->query( $query );
|
||||
}
|
||||
|
||||
@ -2113,7 +2110,6 @@ class wpdb {
|
||||
$this->func_call = "\$db->get_results(\"$query\", $output)";
|
||||
|
||||
if ( $query ) {
|
||||
$this->check_current_query = false;
|
||||
$this->query( $query );
|
||||
} else {
|
||||
return null;
|
||||
@ -2439,6 +2435,8 @@ class wpdb {
|
||||
$this->set_charset( $this->dbh, $charset );
|
||||
}
|
||||
|
||||
$this->check_current_query = false;
|
||||
|
||||
$row = $this->get_row( "SELECT " . implode( ', ', $query ), ARRAY_N );
|
||||
if ( ! $row ) {
|
||||
$this->set_charset( $this->dbh, $connection_charset );
|
||||
|
Loading…
Reference in New Issue
Block a user