Database: Ensure that variables are defined correctly.

There were some cases where some local variables in `wpdb::init_charset()` could be undefined when they were used.

Merge of [38439] to the 4.6 branch.

Props Frozzare.
Fixes #37683.


Built from https://develop.svn.wordpress.org/branches/4.6@38440


git-svn-id: http://core.svn.wordpress.org/branches/4.6@38381 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Gary Pendergast 2016-08-30 07:17:42 +00:00
parent 97095d54c3
commit 1b8d23ca29
2 changed files with 4 additions and 1 deletions

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.6.1-alpha-38346';
$wp_version = '4.6.1-alpha-38440';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -734,6 +734,9 @@ class wpdb {
* @since 3.1.0
*/
public function init_charset() {
$charset = '';
$collate = '';
if ( function_exists('is_multisite') && is_multisite() ) {
$charset = 'utf8';
if ( defined( 'DB_COLLATE' ) && DB_COLLATE ) {