From 29f713ed10566036925329a20707bd94720bc73a Mon Sep 17 00:00:00 2001 From: Platonides Date: Thu, 4 Apr 2013 01:28:33 +0200 Subject: [PATCH] Specify the utf-8 charset on error messages. Although the contents of error messages are English text, and thus it's irrelevant that it gets interpreted as iso-8859-1 instead of utf-8, $wgSitename is printed by DBConnectionError::searchForm(), and that can contain utf-8. Cached pages may also be in utf-8. Change-Id: I81c02493f0824cb010c80f4356f338787d78df6b --- includes/Exception.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/Exception.php b/includes/Exception.php index dc3432031e..21952bbf5b 100644 --- a/includes/Exception.php +++ b/includes/Exception.php @@ -247,7 +247,7 @@ class MWException extends Exception { * It will be either HTML or plain text based on isCommandLine(). */ function report() { - global $wgLogExceptionBacktrace; + global $wgLogExceptionBacktrace, $wgMimeType; $log = $this->getLogMessage(); if ( $log ) { @@ -267,6 +267,7 @@ class MWException extends Exception { } else { header( "HTTP/1.1 500 MediaWiki exception" ); header( "Status: 500 MediaWiki exception", true ); + header( "Content-Type: $wgMimeType; charset=utf-8", true ); $this->reportHTML(); } -- 2.20.1