diff --git a/includes/Api/ApiTitleBlacklist.php b/includes/Api/ApiTitleBlacklist.php index d22a68eb..3fa7465f 100644 --- a/includes/Api/ApiTitleBlacklist.php +++ b/includes/Api/ApiTitleBlacklist.php @@ -72,7 +72,12 @@ class ApiTitleBlacklist extends ApiBase { $res->addValue( 'titleblacklist', 'result', 'blacklisted' ); // there aren't any messages for create(talk|page), using edit for those instead $message = $blacklisted->getErrorMessage( $action !== 'create' ? $action : 'edit' ); - $res->addValue( 'titleblacklist', 'reason', $this->msg( $message, $result )->page( $title )->text() ); + $messageObj = $this->msg( $message, $result )->page( $title ); + if ( $this->getErrorFormatter()->getFormat() === 'html' ) { + $res->addValue( 'titleblacklist', 'reason', $messageObj->parse() ); + } else { + $res->addValue( 'titleblacklist', 'reason', $messageObj->text() ); + } $res->addValue( 'titleblacklist', 'message', $message ); $res->addValue( 'titleblacklist', 'line', htmlspecialchars( $blacklisted->getRaw() ) ); } else { diff --git a/modules/mediawiki.api.titleblacklist.js b/modules/mediawiki.api.titleblacklist.js index 10e9823c..7e82c3f3 100644 --- a/modules/mediawiki.api.titleblacklist.js +++ b/modules/mediawiki.api.titleblacklist.js @@ -25,7 +25,11 @@ this.get( { action: 'titleblacklist', tbaction: 'create', - tbtitle: title.toString() + tbtitle: title.toString(), + errorformat: 'html', + errorlang: mw.config.get( 'wgUserLanguage' ), + errorsuselocal: '', + formatversion: 2 } ) .done( function ( data ) { var result;