From f6d65e533c62f6deb21342d4901ece24497b433e Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 4 Jun 2015 07:31:04 +0200 Subject: Update to MediaWiki 1.25.1 --- includes/exception/MWException.php | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'includes/exception/MWException.php') diff --git a/includes/exception/MWException.php b/includes/exception/MWException.php index 074128f8..478fead1 100644 --- a/includes/exception/MWException.php +++ b/includes/exception/MWException.php @@ -117,10 +117,12 @@ class MWException extends Exception { $args = array_slice( func_get_args(), 2 ); if ( $this->useMessageCache() ) { - return wfMessage( $key, $args )->text(); - } else { - return wfMsgReplaceArgs( $fallback, $args ); + try { + return wfMessage( $key, $args )->text(); + } catch ( Exception $e ) { + } } + return wfMsgReplaceArgs( $fallback, $args ); } /** @@ -139,10 +141,17 @@ class MWException extends Exception { nl2br( htmlspecialchars( MWExceptionHandler::getRedactedTraceAsString( $this ) ) ) . "

\n"; } else { + $logId = MWExceptionHandler::getLogId( $this ); + $type = get_class( $this ); return "
" . - '[' . MWExceptionHandler::getLogId( $this ) . '] ' . - gmdate( 'Y-m-d H:i:s' ) . - ": Fatal exception of type " . get_class( $this ) . "
\n" . + '[' . $logId . '] ' . + gmdate( 'Y-m-d H:i:s' ) . ": " . + $this->msg( "internalerror-fatal-exception", + "Fatal exception of type $1", + $type, + $logId, + MWExceptionHandler::getURL( $this ) + ) . "\n" . ""; @@ -222,8 +231,6 @@ class MWException extends Exception { public function report() { global $wgMimeType; - MWExceptionHandler::logException( $this ); - 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( $this ) ); -- cgit v1.2.3-54-g00ecf