Commit graph

15 commits

Author SHA1 Message Date
Marius Hoch fc27474834 Fixing several issues with the titleblacklist API
I've fixed four issue with the API of this extension:
1. The extension always assumed the user wants to override the
   blacklist, if he's allowed to do so, but that's not the case.
   Introduced 'tbnooverride' to prevent that.
2. The API used actions not internally supported by
   TitleBlacklistEntry::matches() which made it impossible to check
   whether an account name is ok, if the regexp which would prevent
   this was set to new account only. Therefore I've introduced the
   new action 'new-account'.
3. Same as 2 for the 'upload'
4. The API always returned the 'titleblacklist-forbidden-edit'
   message, even if there was a more suitable one. Fixed that.

Example:
 https://meta.wikimedia.org/w/api.php?action=titleblacklist&tbtitle=User:Steward&tbaction=create
 (this should match the expression .*steward.* <newaccountonly> on
 https://meta.wikimedia.org/wiki/Title_blacklist but it doesn't)

Furthermore I've adjusted the unit tests slightly to test whether
tboverride works and whether <newaccountonly> works.

Change-Id: I2d948c84de39c6ee1c1eea7e6cd7b31506d6cb92
2012-10-27 14:41:15 +02:00
Siebrand Mazeland 16f32456ad Maintenance for TitleBlacklist extension.
* Use Message class.
* Remove trailing whitespace from 'titlewhitelist'.
* stylize.php.
* Update .gitignore.

Change-Id: Ie78fa25816808b0a695cc20630097326fb4cf705
2012-09-18 15:57:57 +02:00
Antoine Musso ec5111d491 createContext -> getContext
createContext was deprecated in 1.19.

Change-Id: Idf427b2f1f004515f12f1089472f2d6d39a40939
2012-08-29 14:56:04 +02:00
John Du Hart 2a563d7709 API get* functions should be public 2011-08-26 23:50:06 +00:00
Roan Kattouw 86645894cd (bug 30510) TitleBlacklist API barfs on invalid titles 2011-08-22 20:56:19 +00:00
Sam Reed 29c00b0057 $result is already used
fu r95241
2011-08-22 20:29:29 +00:00
Sam Reed a2f5ccd2bf Subclass ApiBase
Create a temporary variable for result
2011-08-22 20:27:57 +00:00
Sam Reed 6778696cab svn:keywords Id 2011-08-22 20:21:08 +00:00
Ian Baker 349ac95278 Added raw message name to output, so localization can happen on the client side if necessary.
Added another line to test source, for checking custom error messages
2011-08-01 21:36:16 +00:00
Alexandre Emsenhuber 661285c2db Added TitleBlacklist::singleton() to get an instance of the TitleBlacklist instead of having to use $wgTitleBlacklist and call efInitTitleBlacklist() 2011-07-30 15:13:28 +00:00
Ian Baker a9b8637fbe Added additional entry for non-automated testing
Added additional return data: raw blacklist line
switched to wfMessage from wfMsg
updated tests
followup to r92805
2011-07-29 17:19:51 +00:00
Ian Baker 039c877658 changed api output for blacklisted entries to be something more correct and informative ("error" is misleading).
followup to r93137
2011-07-28 20:32:48 +00:00
Ian Baker 4e57d6c1e9 Fixed unit test
Removed unnecessary method, re r92807
2011-07-23 00:23:09 +00:00
Ian Baker ac58cd3332 removed cruft, followup to r92805 2011-07-21 22:10:06 +00:00
Ian Baker 00242b75f1 Added an API to TitleBlackList to make it possible to check the blacklist in advance. Makes for more responsive UI. 2011-07-21 22:08:44 +00:00