X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiErrorFormatter.php;h=183f7e2bb34ef470b2c93f830214b87aaaaa23d4;hp=5484a78efe0359840c906b504fa27b2a3f46ee04;hb=a8379682a46a428320c88702c800a6107c015137;hpb=2dd58ade75d15a5895c0c010e17b6f729a0f72fe diff --git a/includes/api/ApiErrorFormatter.php b/includes/api/ApiErrorFormatter.php index 5484a78efe..183f7e2bb3 100644 --- a/includes/api/ApiErrorFormatter.php +++ b/includes/api/ApiErrorFormatter.php @@ -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( '!!', '"', $text ); // Strip tags and decode. - $ret = html_entity_decode( strip_tags( $ret ), ENT_QUOTES | ENT_HTML5 ); + $ret = Sanitizer::stripAllTags( $ret ); return $ret; }