From 59c8195612bd4c7710ffcdc32f1cf1caaa6ba43f Mon Sep 17 00:00:00 2001 From: Glaisher Date: Wed, 8 Jun 2016 22:04:48 +0500 Subject: [PATCH] Show request id in Exception pages even if $wgShowExceptionDetails is false Bug: T137277 Change-Id: I5ff7e4ce0336616f8a9bcc39031a0a032bd9a931 --- includes/exception/MWExceptionHandler.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 . '"'; } /** -- 2.20.1