Commit graph

22 commits

Author SHA1 Message Date
Umherirrender 55d068708a Add phpcs and make pass
Change-Id: If5a2ec9700148eb842d6580945e51e1942a2e0ed
2017-06-06 18:18:36 +02:00
Umherirrender 968c6e8cd2 Break long lines
Prepare to make phpcs pass

Change-Id: I08a1b17d1861a7719ff71087fcbb82aae55f4948
2017-06-06 17:52:28 +02:00
jenkins-bot 087a0e7733 Merge "Update for API error i18n" 2016-12-06 09:31:13 +00:00
Brad Jorsch a2ed65ffdd API: Fix tbnooverride parameter type
This is treated as a boolean parameter, let's make it actually be one so
it shows up correctly in ApiSandbox.

Change-Id: Ie2d2bf28165eca8883e8453a88a9c4e2d9603a78
2016-11-15 08:55:02 -05:00
Brad Jorsch 5652e3af69 Update for API error i18n
See Iae0e2ce3.

Change-Id: I2e1bb975bb0045476c03ebe6cdec00259bae22ec
2016-11-14 12:48:26 -05:00
Brad Jorsch 75a8813c86 Remove pre-1.25 API compatibility code
Since this extension uses extension.json, it already requires 1.25+ so
no need to keep the old code around.

Change-Id: I4acbeec983367f0bd3e7b1996d377bb6e5835d63
2016-09-20 15:32:21 -04:00
Brad Jorsch 8c8c8bbe92 Add i18n for API module help
MediaWiki core change I04b1a384 added support for i18n of API module
help. This takes advantage of that while still maintaining backwards
compatibility with earlier versions of MediaWiki.

Once support for MediaWiki before 1.25 is dropped, the methods marked
deprecated in this patch may be removed.

Change-Id: I67395aff48185f3e09da31b51a08aa2541fe6a17
2014-10-29 16:48:10 -04:00
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