From 396b28f3d881f5debd888ba9bb9b47c2d478a76f Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 15 Dec 2008 18:02:47 +0100 Subject: update to Mediawiki 1.13.3; some cleanups --- includes/Exception.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'includes/Exception.php') diff --git a/includes/Exception.php b/includes/Exception.php index 74820204..ab25f0b8 100644 --- a/includes/Exception.php +++ b/includes/Exception.php @@ -274,7 +274,16 @@ function wfReportException( Exception $e ) { } } } else { - echo $e->__toString(); + $message = "Unexpected non-MediaWiki exception encountered, of type \"" . get_class( $e ) . "\"\n" . + $e->__toString() . "\n"; + if ( $GLOBALS['wgShowExceptionDetails'] ) { + $message .= "\n" . $e->getTraceAsString() ."\n"; + } + if ( !empty( $GLOBALS['wgCommandLineMode'] ) ) { + wfPrintError( $message ); + } else { + echo nl2br( htmlspecialchars( $message ) ). "\n"; + } } } -- cgit v1.2.2