Merge "Skin: Make skins aware of their registered skin name"
[lhc/web/wiklou.git] / includes / api / ApiErrorFormatter.php
index 5484a78..183f7e2 100644 (file)
@@ -160,6 +160,9 @@ class ApiErrorFormatter {
                if ( $exception instanceof ILocalizedException ) {
                        $msg = $exception->getMessageObject();
                        $params = [];
+               } elseif ( $exception instanceof MessageSpecifier ) {
+                       $msg = Message::newFromSpecifier( $exception );
+                       $params = [];
                } else {
                        // Extract code and data from the exception, if applicable
                        if ( $exception instanceof UsageException ) {
@@ -254,7 +257,7 @@ class ApiErrorFormatter {
                $ret = preg_replace( '!</?(var|kbd|samp|code)>!', '"', $text );
 
                // Strip tags and decode.
-               $ret = html_entity_decode( strip_tags( $ret ), ENT_QUOTES | ENT_HTML5 );
+               $ret = Sanitizer::stripAllTags( $ret );
 
                return $ret;
        }