Merge "Add SPARQL client to core"
[lhc/web/wiklou.git] / includes / exception / MWException.php
index 8c1f8dc..16f226c 100644 (file)
@@ -55,7 +55,7 @@ class MWException extends Exception {
                global $wgLang;
 
                foreach ( $this->getTrace() as $frame ) {
-                       if ( isset( $frame['class'] ) && $frame['class'] === 'LocalisationCache' ) {
+                       if ( isset( $frame['class'] ) && $frame['class'] === LocalisationCache::class ) {
                                return false;
                        }
                }
@@ -102,15 +102,17 @@ class MWException extends Exception {
                } else {
                        $logId = WebRequest::getRequestId();
                        $type = static::class;
-                       return "<div class=\"errorbox\">" .
-                       '[' . $logId . '] ' .
-                       gmdate( 'Y-m-d H:i:s' ) . ": " .
-                       $this->msg( "internalerror-fatal-exception",
-                               "Fatal exception of type $1",
-                               $type,
-                               $logId,
-                               MWExceptionHandler::getURL( $this )
-                       ) . "</div>\n" .
+                       return Html::errorBox(
+                       htmlspecialchars(
+                               '[' . $logId . '] ' .
+                               gmdate( 'Y-m-d H:i:s' ) . ": " .
+                               $this->msg( "internalerror-fatal-exception",
+                                       "Fatal exception of type $1",
+                                       $type,
+                                       $logId,
+                                       MWExceptionHandler::getURL( $this )
+                               )
+                       ) ) .
                        "<!-- Set \$wgShowExceptionDetails = true; " .
                        "at the bottom of LocalSettings.php to show detailed " .
                        "debugging information. -->";