This reverts commit ecf9bc4424.
Fixes copy paste fail from Id686d75e0a6b475a79f7f715791d867dc6fb400c,
should've been preauth, not primary
Change-Id: I8c5456af1ca3bf89c4fd1791b113ac3a16350989
* Use only a single error code 'titleblacklist-forbidden'
to allow API users to easily identify TitleBlacklist errors.
* Return the internal code ('message') and the matching entry's text
('line') in machine-readable format, same as action=titleblacklist
(depends on I1334ba21a2862973a9d8ff5be2c9bec06a82698b in MediaWiki).
This bumps the version requirement to 1.27, as older MediaWiki
versions would ignore the error in new format entirely.
Example API output change, for action=edit:
Before:
{
"error": {
"code": "custom-message",
"info": "TitleBlacklist prevents this title from being created",
"*": "See http://localhost/w/api.php for API usage"
}
}
After:
{
"error": {
"code": "titleblacklist-forbidden",
"info": "TitleBlacklist prevents this title from being created",
"message": "custom-message",
"line": ".*test.* <errmsg=custom-message> # test rule",
"*": "See http://localhost/w/api.php for API usage"
}
}
Bug: T115258
Change-Id: I42a0c5b0ea7e61088dd609b764dd7d1396c60cd5