mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TitleBlacklist
synced 2024-11-27 15:30:48 +00:00
api: Parse error message with the title to check
When the custom error message contains {{PAGENAME}} or other title based variables, there are currently parsed as "Badtitle/dummy_title_for_API_calls_set_in_api.php" The same custom message is shown correctly on index.php Bug: T340923 Change-Id: I4c1dc6660976de54ff6ba8f8f7a5768371e61e80
This commit is contained in:
parent
f87949916c
commit
8584bb40bd
|
@ -72,7 +72,7 @@ class ApiQueryTitleBlacklist 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 )->text() );
|
||||
$res->addValue( 'titleblacklist', 'reason', $this->msg( $message, $result )->page( $title )->text() );
|
||||
$res->addValue( 'titleblacklist', 'message', $message );
|
||||
$res->addValue( 'titleblacklist', 'line', htmlspecialchars( $blacklisted->getRaw() ) );
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue