From 4ea6737fbab06f302037b4c39ab32e9eee5a95be Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 13 Sep 2006 15:27:04 +0000 Subject: [PATCH] * (bug 7312) Don't emit SET NAMES utf8 if connection failed --- RELEASE-NOTES | 1 + includes/Database.php | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d78a15823b..6ed8a09dae 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -198,6 +198,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 6216) The immobile namespace message does not mention the source page * (bug 7299) Normalize username filter on Special:Newpages * (bug 7306) RTL text in an LTR wiki breaks appearance of Special:Recentchanges +* (bug 7312) Don't emit SET NAMES utf8 if connection failed == Languages updated == diff --git a/includes/Database.php b/includes/Database.php index 0c1d6dfaf7..afd08060ea 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -516,17 +516,17 @@ class Database { $success = (bool)$this->mConn; } - if ( !$success ) { + if ( $success ) { + global $wgDBmysql5; + if( $wgDBmysql5 ) { + // Tell the server we're communicating with it in UTF-8. + // This may engage various charset conversions. + $this->query( 'SET NAMES utf8' ); + } + } else { $this->reportConnectionError(); } - global $wgDBmysql5; - if( $wgDBmysql5 ) { - // Tell the server we're communicating with it in UTF-8. - // This may engage various charset conversions. - $this->query( 'SET NAMES utf8' ); - } - $this->mOpened = $success; wfProfileOut( __METHOD__ ); return $success; -- 2.20.1