diff options
author | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:32:59 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@sbcglobal.net> | 2016-05-01 15:32:59 -0400 |
commit | 6dc1997577fab2c366781fd7048144935afa0012 (patch) | |
tree | 8918d28c7ab4342f0738985e37af1dfc42d0e93a /includes/exception/MWException.php | |
parent | 150f94f051128f367bc89f6b7e5f57eb2a69fc62 (diff) | |
parent | fa89acd685cb09cdbe1c64cbb721ec64975bbbc1 (diff) |
Merge commit 'fa89acd'
# Conflicts:
# .gitignore
# extensions/ArchInterWiki.sql
Diffstat (limited to 'includes/exception/MWException.php')
-rw-r--r-- | includes/exception/MWException.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/includes/exception/MWException.php b/includes/exception/MWException.php index 478fead1..c0186f9f 100644 --- a/includes/exception/MWException.php +++ b/includes/exception/MWException.php @@ -238,8 +238,7 @@ class MWException extends Exception { } elseif ( self::isCommandLine() ) { MWExceptionHandler::printError( $this->getText() ); } else { - self::header( 'HTTP/1.1 500 MediaWiki exception' ); - self::header( 'Status: 500 MediaWiki exception' ); + self::statusHeader( 500 ); self::header( "Content-Type: $wgMimeType; charset=utf-8" ); $this->reportHTML(); @@ -266,4 +265,9 @@ class MWException extends Exception { header( $header ); } } + private static function statusHeader( $code ) { + if ( !headers_sent() ) { + HttpStatus::header( $code ); + } + } } |