X-Git-Url: http://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fexception%2FMWExceptionRenderer.php;h=5d75036566f616c5ccf3bbfb18f1ac23f8b86558;hp=dc8dfd0b3ec10c8cc9c715764c111ca0e3fe10f4;hb=0e339243f1dbbba5f87a54b116c23e0daec8e2e4;hpb=0c2687f44eb0e8c7f480b7303f89056682ba0bfb diff --git a/includes/exception/MWExceptionRenderer.php b/includes/exception/MWExceptionRenderer.php index dc8dfd0b3e..5d75036566 100644 --- a/includes/exception/MWExceptionRenderer.php +++ b/includes/exception/MWExceptionRenderer.php @@ -47,13 +47,15 @@ class MWExceptionRenderer { self::printError( self::getText( $e ) ); } elseif ( $mode === self::AS_PRETTY ) { self::statusHeader( 500 ); + self::header( "Content-Type: $wgMimeType; charset=utf-8" ); if ( $e instanceof DBConnectionError ) { self::reportOutageHTML( $e ); } else { - self::header( "Content-Type: $wgMimeType; charset=utf-8" ); self::reportHTML( $e ); } } else { + self::statusHeader( 500 ); + self::header( "Content-Type: $wgMimeType; charset=utf-8" ); if ( $eNew ) { $message = "MediaWiki internal error.\n\n"; if ( self::showBackTrace( $e ) ) { @@ -292,7 +294,7 @@ class MWExceptionRenderer { * @param Exception|Throwable $e */ private static function reportOutageHTML( $e ) { - global $wgShowDBErrorBacktrace, $wgShowHostnames, $wgShowSQLErrors; + global $wgShowDBErrorBacktrace, $wgShowHostnames, $wgShowSQLErrors, $wgSitename; $sorry = htmlspecialchars( self::msg( 'dberr-problems', @@ -317,55 +319,20 @@ class MWExceptionRenderer { } MessageCache::singleton()->disable(); // no DB access - - $html = "

$sorry

$again

$info

"; + $html = "\n" . + '' . + '' . + htmlspecialchars( $wgSitename ) . + '' . + '' . + "

$sorry

$again

$info

"; if ( $wgShowDBErrorBacktrace ) { $html .= '

Backtrace:

' .
 				htmlspecialchars( $e->getTraceAsString() ) . '
'; } - $html .= '
'; - $html .= self::googleSearchForm(); - + $html .= ''; echo $html; } - - /** - * @return string - */ - private static function googleSearchForm() { - global $wgSitename, $wgCanonicalServer, $wgRequest; - - $usegoogle = htmlspecialchars( self::msg( - 'dberr-usegoogle', - 'You can try searching via Google in the meantime.' - ) ); - $outofdate = htmlspecialchars( self::msg( - 'dberr-outofdate', - 'Note that their indexes of our content may be out of date.' - ) ); - $googlesearch = htmlspecialchars( self::msg( 'searchbutton', 'Search' ) ); - $search = htmlspecialchars( $wgRequest->getVal( 'search' ) ); - $server = htmlspecialchars( $wgCanonicalServer ); - $sitename = htmlspecialchars( $wgSitename ); - $trygoogle = <<$usegoogle
-$outofdate - -
- - - - - - -

- - -

-
-EOT; - return $trygoogle; - } }