'none' => 'ApiFormatNone',
];
- // @codingStandardsIgnoreStart String contenation on "msg" not allowed to break long line
/**
* List of user roles that are specifically relevant to the API.
* [ 'right' => [ 'msg' => 'Some message with a $1',
'params' => [ ApiBase::LIMIT_SML2, ApiBase::LIMIT_BIG2 ]
]
];
- // @codingStandardsIgnoreEnd
/**
* @var ApiFormatBase
if ( ( $e instanceof DBQueryError ) && !$config->get( 'ShowSQLErrors' ) ) {
$params = [ 'apierror-databaseerror', WebRequest::getRequestId() ];
} else {
- $params = [
- 'apierror-exceptioncaught',
- WebRequest::getRequestId(),
- $e instanceof ILocalizedException
- ? $e->getMessageObject()
- : wfEscapeWikiText( $e->getMessage() )
- ];
+ if ( $e instanceof ILocalizedException ) {
+ $msg = $e->getMessageObject();
+ } elseif ( $e instanceof MessageSpecifier ) {
+ $msg = Message::newFromSpecifier( $e );
+ } else {
+ $msg = wfEscapeWikiText( $e->getMessage() );
+ }
+ $params = [ 'apierror-exceptioncaught', WebRequest::getRequestId(), $msg ];
}
$messages[] = ApiMessage::create( $params, $code );
}
$id = Sanitizer::escapeIdForAttribute( 'main/datatypes', Sanitizer::ID_PRIMARY );
$idFallback = Sanitizer::escapeIdForAttribute( 'main/datatypes', Sanitizer::ID_FALLBACK );
$headline = Linker::makeHeadline( min( 6, $level ),
- ' class="apihelp-header"',
+ ' class="apihelp-header">',
$id,
$header,
'',
$id = Sanitizer::escapeIdForAttribute( 'main/credits', Sanitizer::ID_PRIMARY );
$idFallback = Sanitizer::escapeIdForAttribute( 'main/credits', Sanitizer::ID_FALLBACK );
$headline = Linker::makeHeadline( min( 6, $level ),
- ' class="apihelp-header"',
+ ' class="apihelp-header">',
$id,
$header,
'',