From fd7979ad63f2f5570d27f8bb4c4a7630a4ed22a4 Mon Sep 17 00:00:00 2001 From: Gary Pendergast Date: Tue, 30 Aug 2016 07:13:31 +0000 Subject: [PATCH] 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. Props Frozzare. Fixes #37683 for trunk. git-svn-id: https://develop.svn.wordpress.org/trunk@38439 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/wp-db.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wp-includes/wp-db.php b/src/wp-includes/wp-db.php index 102deab448..3c07900a72 100644 --- a/src/wp-includes/wp-db.php +++ b/src/wp-includes/wp-db.php @@ -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 ) {