dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Skin: Make skins aware of their registered skin name"
[lhc/web/wiklou.git]
/
includes
/
api
/
ApiErrorFormatter.php
diff --git
a/includes/api/ApiErrorFormatter.php
b/includes/api/ApiErrorFormatter.php
index
5484a78
..
183f7e2
100644
(file)
--- a/
includes/api/ApiErrorFormatter.php
+++ b/
includes/api/ApiErrorFormatter.php
@@
-160,6
+160,9
@@
class ApiErrorFormatter {
if ( $exception instanceof ILocalizedException ) {
$msg = $exception->getMessageObject();
$params = [];
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 ) {
} 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 = 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;
}
return $ret;
}