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 ) {
$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;
}