From: Glaisher Date: Wed, 8 Jun 2016 17:04:48 +0000 (+0500) Subject: Show request id in Exception pages even if $wgShowExceptionDetails is false X-Git-Tag: 1.31.0-rc.0~6568^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=59c8195612bd4c7710ffcdc32f1cf1caaa6ba43f;p=lhc%2Fweb%2Fwiklou.git Show request id in Exception pages even if $wgShowExceptionDetails is false Bug: T137277 Change-Id: I5ff7e4ce0336616f8a9bcc39031a0a032bd9a931 --- diff --git a/includes/exception/MWExceptionHandler.php b/includes/exception/MWExceptionHandler.php index 63adc29bfd..e4ff5f3330 100644 --- a/includes/exception/MWExceptionHandler.php +++ b/includes/exception/MWExceptionHandler.php @@ -93,10 +93,11 @@ class MWExceptionHandler { } } } else { - $message = "Exception encountered, of type \"" . get_class( $e ) . "\""; - - if ( $wgShowExceptionDetails ) { - $message .= "\n" . self::getLogMessage( $e ) . "\nBacktrace:\n" . + if ( !$wgShowExceptionDetails ) { + $message = self::getPublicLogMessage( $e ); + } else { + $message = self::getLogMessage( $e ) . + "\nBacktrace:\n" . self::getRedactedTraceAsString( $e ) . "\n"; } @@ -492,7 +493,7 @@ TXT; $type = get_class( $e ); return '[' . $reqId . '] ' . gmdate( 'Y-m-d H:i:s' ) . ': ' - . 'Fatal exception of type ' . $type; + . 'Fatal exception of type "' . $type . '"'; } /**