From 55742904c0b072f65582f915f2e1566c33e474e6 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Mon, 9 Feb 2015 00:34:25 +0000 Subject: [PATCH] WPDB: When we're removing invalid text text from strings with multiple different character sets, `wpdb::strip_invalid_text()` wasn't correctly switching connection character sets. Fixes #31262 Built from https://develop.svn.wordpress.org/trunk@31371 git-svn-id: http://core.svn.wordpress.org/trunk@31352 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/version.php | 2 +- wp-includes/wp-db.php | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-includes/version.php b/wp-includes/version.php index d3c9a0134d..4e0db0c283 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31370'; +$wp_version = '4.2-alpha-31371'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-includes/wp-db.php b/wp-includes/wp-db.php index 6f60e9c31a..f31e5caa67 100644 --- a/wp-includes/wp-db.php +++ b/wp-includes/wp-db.php @@ -2461,7 +2461,8 @@ class wpdb { } // Change the charset to match the string(s) we're converting - if ( $charset !== $this->charset ) { + if ( $charset !== $connection_charset ) { + $connection_charset = $charset; $this->set_charset( $this->dbh, $charset ); } @@ -2482,7 +2483,7 @@ class wpdb { // Don't forget to change the charset back! if ( $connection_charset !== $this->charset ) { - $this->set_charset( $this->dbh, $connection_charset ); + $this->set_charset( $this->dbh ); } }