X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fexception%2FMWExceptionRenderer.php;h=8fdc417c1ef3724b59ab28493af7bfa029669748;hb=c971615fe100535b2c2bddd6668961ece8bc9b8d;hp=e242da348b7e1149c00b80dd2b70e6abc411f8bb;hpb=94f52cb76fd07d4a175bffe17320a598d07f5bd6;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/exception/MWExceptionRenderer.php b/includes/exception/MWExceptionRenderer.php index e242da348b..8fdc417c1e 100644 --- a/includes/exception/MWExceptionRenderer.php +++ b/includes/exception/MWExceptionRenderer.php @@ -35,11 +35,6 @@ class MWExceptionRenderer { public static function output( $e, $mode, $eNew = null ) { global $wgMimeType; - if ( $e instanceof DBConnectionError ) { - self::reportOutageHTML( $e ); - return; - } - if ( defined( 'MW_API' ) ) { // Unhandled API exception, we can't be sure that format printer is alive self::header( 'MediaWiki-API-Error: internal_api_error_' . get_class( $e ) ); @@ -47,9 +42,13 @@ class MWExceptionRenderer { } elseif ( self::isCommandLine() ) { self::printError( self::getText( $e ) ); } elseif ( $mode === self::AS_PRETTY ) { - self::statusHeader( 500 ); - self::header( "Content-Type: $wgMimeType; charset=utf-8" ); - self::reportHTML( $e ); + if ( $e instanceof DBConnectionError ) { + self::reportOutageHTML( $e ); + } else { + self::statusHeader( 500 ); + self::header( "Content-Type: $wgMimeType; charset=utf-8" ); + self::reportHTML( $e ); + } } else { if ( $eNew ) { $message = "MediaWiki internal error.\n\n"; @@ -172,7 +171,7 @@ class MWExceptionRenderer { } else { // Show any custom GUI message before the details if ( $e instanceof MessageSpecifier ) { - $wgOut->addHtml( Message::newFromSpecifier( $e )->escaped() ); + $wgOut->addHTML( Message::newFromSpecifier( $e )->escaped() ); } $wgOut->addHTML( self::getHTML( $e ) ); }