X-Git-Url: https://scripts.mit.edu/gitweb/autoinstallsdev/mediawiki.git/blobdiff_plain/74c929b24b048c9f1e31e17db757ae4195cd7673..dc9cc5d707f5a612938cc9371614cc41c328fda2:/includes/Exception.php diff --git a/includes/Exception.php b/includes/Exception.php index eb715986..5f808b20 100644 --- a/includes/Exception.php +++ b/includes/Exception.php @@ -161,23 +161,26 @@ class MWException extends Exception { if( $hookResult = $this->runHooks( get_class( $this ) . "Raw" ) ) { die( $hookResult ); } - echo $this->htmlHeader(); - echo $this->getHTML(); - echo $this->htmlFooter(); + if ( defined( 'MEDIAWIKI_INSTALL' ) || $this->htmlBodyOnly() ) { + echo $this->getHTML(); + } else { + echo $this->htmlHeader(); + echo $this->getHTML(); + echo $this->htmlFooter(); + } } } /** * Output a report about the exception and takes care of formatting. - * It will be either HTML or plain text based on $wgCommandLineMode. + * It will be either HTML or plain text based on isCommandLine(). */ function report() { - global $wgCommandLineMode; $log = $this->getLogMessage(); if ( $log ) { wfDebugLog( 'exception', $log ); } - if ( $wgCommandLineMode ) { + if ( self::isCommandLine() ) { wfPrintError( $this->getText() ); } else { $this->reportHTML(); @@ -204,7 +207,7 @@ class MWException extends Exception {