X-Git-Url: https://git.cyclocoop.org/%28%28?a=blobdiff_plain;f=includes%2Fexception%2FMWExceptionRenderer.php;h=60d760f3aa2bba4df3cc107009bd9ee6c422e3f6;hb=f4a53c54065c385172363416eb3cb44b67585ca2;hp=bd4393445ba481b2d288e067c818cd088a1a071d;hpb=f3293a45ee0fe0dda4053d0071cc46d6cca906e4;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/exception/MWExceptionRenderer.php b/includes/exception/MWExceptionRenderer.php index bd4393445b..60d760f3aa 100644 --- a/includes/exception/MWExceptionRenderer.php +++ b/includes/exception/MWExceptionRenderer.php @@ -16,7 +16,6 @@ * http://www.gnu.org/copyleft/gpl.html * * @file - * @author Aaron Schulz */ use Wikimedia\Rdbms\DBConnectionError; @@ -96,9 +95,14 @@ class MWExceptionRenderer { } } + // Don't even bother with OutputPage if there's no Title context set, + // (e.g. we're in RL code on load.php) - the Skin system (and probably + // most of MediaWiki) won't work. + return ( !empty( $GLOBALS['wgFullyInitialised'] ) && !empty( $GLOBALS['wgOut'] ) && + RequestContext::getMain()->getTitle() && !defined( 'MEDIAWIKI_INSTALL' ) ); } @@ -207,7 +211,7 @@ class MWExceptionRenderer { "\nBacktrace:\n" . MWExceptionHandler::getRedactedTraceAsString( $e ) . "\n"; } else { - return self::getShowBacktraceError( $e ); + return self::getShowBacktraceError( $e ) . "\n"; } } @@ -238,7 +242,7 @@ class MWExceptionRenderer { $vars[] = '$wgShowDBErrorBacktrace = true;'; } $vars = implode( ' and ', $vars ); - return "Set $vars at the bottom of LocalSettings.php to show detailed debugging information\n"; + return "Set $vars at the bottom of LocalSettings.php to show detailed debugging information."; } /** @@ -301,7 +305,7 @@ class MWExceptionRenderer { if ( $wgShowHostnames || $wgShowSQLErrors ) { $info = str_replace( '$1', - Html::element( 'span', [ 'dir' => 'ltr' ], htmlspecialchars( $e->getMessage() ) ), + Html::element( 'span', [ 'dir' => 'ltr' ], $e->getMessage() ), htmlspecialchars( self::msg( 'dberr-info', '($1)' ) ) ); } else {