X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fexception%2FMWException.php;h=b3e9422b8d32238ddb9d3956c59c02e1ada735a8;hb=065b21b4bdd49ffca494ff905de29bfc500ed535;hp=8c1f8dc9683e4ce6f5ca96ff3e5d8693aaab4876;hpb=d5a7166771613dfe4ed9fb75fa5efeced6134bd1;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/exception/MWException.php b/includes/exception/MWException.php index 8c1f8dc968..b3e9422b8d 100644 --- a/includes/exception/MWException.php +++ b/includes/exception/MWException.php @@ -55,7 +55,7 @@ class MWException extends Exception { global $wgLang; foreach ( $this->getTrace() as $frame ) { - if ( isset( $frame['class'] ) && $frame['class'] === 'LocalisationCache' ) { + if ( isset( $frame['class'] ) && $frame['class'] === LocalisationCache::class ) { return false; } } @@ -102,15 +102,17 @@ class MWException extends Exception { } else { $logId = WebRequest::getRequestId(); $type = static::class; - return "
" . - '[' . $logId . '] ' . - gmdate( 'Y-m-d H:i:s' ) . ": " . - $this->msg( "internalerror-fatal-exception", - "Fatal exception of type $1", - $type, - $logId, - MWExceptionHandler::getURL( $this ) - ) . "
\n" . + return Html::errorBox( + htmlspecialchars( + '[' . $logId . '] ' . + gmdate( 'Y-m-d H:i:s' ) . ": " . + $this->msg( "internalerror-fatal-exception", + "Fatal exception of type $1", + $type, + $logId, + MWExceptionHandler::getURL( $this ) + ) + ) ) . ""; @@ -187,7 +189,7 @@ class MWException extends Exception { } elseif ( self::isCommandLine() ) { $message = $this->getText(); // T17602: STDERR may not be available - if ( defined( 'STDERR' ) ) { + if ( !defined( 'MW_PHPUNIT_TEST' ) && defined( 'STDERR' ) ) { fwrite( STDERR, $message ); } else { echo $message;