From 3e59f15bb0681ce951d40622d0fe73291e42ffbc Mon Sep 17 00:00:00 2001 From: Platonides Date: Thu, 31 May 2012 19:15:33 +0200 Subject: [PATCH] Set the status code to 500 on exceptions. Should fix bug 37140, scripts served through action=raw failing due to being served a html error page. As well as such as giving a better behavior such as for search engines. This could affect IE users by showing them smart errors instead of the content, though. Change-Id: I5d680fe10db6d61d91e898323bd5fb755a07135d --- includes/Exception.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/includes/Exception.php b/includes/Exception.php index 9c472bf9df..9f6d5bdc6b 100644 --- a/includes/Exception.php +++ b/includes/Exception.php @@ -246,6 +246,9 @@ class MWException extends Exception { } elseif ( self::isCommandLine() ) { MWExceptionHandler::printError( $this->getText() ); } else { + header( "HTTP/1.1 500 MediaWiki exception" ); + header( "Status: 500 MediaWiki exception", true ); + $this->reportHTML(); } } -- 2.20.1