Merge "Add tablesUsed to RevisionStoreDbTest"
[lhc/web/wiklou.git] / includes / exception / MWExceptionRenderer.php
index 60d760f..dc8dfd0 100644 (file)
@@ -33,7 +33,7 @@ class MWExceptionRenderer {
 
        /**
         * @param Exception|Throwable $e Original exception
-        * @param integer $mode MWExceptionExposer::AS_* constant
+        * @param int $mode MWExceptionExposer::AS_* constant
         * @param Exception|Throwable|null $eNew New exception from attempting to show the first
         */
        public static function output( $e, $mode, $eNew = null ) {
@@ -90,7 +90,7 @@ class MWExceptionRenderer {
        private static function useOutputPage( $e ) {
                // Can the extension use the Message class/wfMessage to get i18n-ed messages?
                foreach ( $e->getTrace() as $frame ) {
-                       if ( isset( $frame['class'] ) && $frame['class'] === 'LocalisationCache' ) {
+                       if ( isset( $frame['class'] ) && $frame['class'] === LocalisationCache::class ) {
                                return false;
                        }
                }
@@ -128,7 +128,7 @@ class MWExceptionRenderer {
 
                        // Show any custom GUI message before the details
                        if ( $e instanceof MessageSpecifier ) {
-                               $wgOut->addHTML( Message::newFromSpecifier( $e )->escaped() );
+                               $wgOut->addHTML( Html::element( 'p', [], Message::newFromSpecifier( $e )->text() ) );
                        }
                        $wgOut->addHTML( self::getHTML( $e ) );
 
@@ -169,14 +169,15 @@ class MWExceptionRenderer {
                } else {
                        $logId = WebRequest::getRequestId();
                        $html = "<div class=\"errorbox mw-content-ltr\">" .
-                               '[' . $logId . '] ' .
-                               gmdate( 'Y-m-d H:i:s' ) . ": " .
-                               self::msg( "internalerror-fatal-exception",
-                                       "Fatal exception of type $1",
-                                       get_class( $e ),
-                                       $logId,
-                                       MWExceptionHandler::getURL()
-                               ) . "</div>\n" .
+                               htmlspecialchars(
+                                       '[' . $logId . '] ' .
+                                       gmdate( 'Y-m-d H:i:s' ) . ": " .
+                                       self::msg( "internalerror-fatal-exception",
+                                               "Fatal exception of type $1",
+                                               get_class( $e ),
+                                               $logId,
+                                               MWExceptionHandler::getURL()
+                               ) ) . "</div>\n" .
                                "<!-- " . wordwrap( self::getShowBacktraceError( $e ), 50 ) . " -->";
                }
 
@@ -262,7 +263,7 @@ class MWExceptionRenderer {
        }
 
        /**
-        * @param integer $code
+        * @param int $code
         */
        private static function statusHeader( $code ) {
                if ( !headers_sent() ) {