Commit graph

13 commits

Author SHA1 Message Date
Kunal Mehta 6863a39ed9 Optionally integrate with AntiSpoof
Introduces a new "antispoof" parameter. If set, try to normalize
the title using the AntiSpoof extension.

Bug: 53901
Change-Id: I9b3c5f5f5d9eeda65562fd83e21c9c2ba97e5569
2013-11-13 15:30:04 -08:00
Marius Hoch b6325e875b Fix the use of globals in ApiQueryTitleBlacklistTest
Change-Id: I5461277f06f336142f2de0aaf122a8ea767d74a4
2013-05-15 14:14:43 +02:00
Victor Vasiliev 52bab2daed (bug 36939) Introduce a way to limit username filter to certain sources.
* Name all sources and track them inside the entries. This should be
  fully backwards-compatible with previous configuration format,
  since numbers may be a legitimate source names as well.
* Introduce $wgTitleBlacklistUsernameSources as a variable which allows
  to specify which sources may be used for filtering usernames.

Change-Id: Ia2702370c85f317c763e345c8f92cb38e23e4196
2013-02-20 22:54:25 -08: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 506470fd79 tests: switch parameters in assertEquals()
assertEquals has the expect as first parameter.

Change-Id: Ic742aae7c84444817de7855b004695a32195d18a
2012-08-29 15:51:27 +02:00
Antoine Musso 31c466e0f7 tests: split listed/unlisted tests
Factored out common code in setup(), that also fixes the tests on my
local machine.

Change-Id: I4083c27842ccb475e2ce3cfbffb6cd35cbd15cc0
2012-08-29 13:47:38 +00:00
Sam Reed e6975d6152 Fix more comments 2011-10-14 21:30:16 +00:00
Ian Baker 74c1bef009 checking in tests that were missed in r93659 2011-08-01 22:44:54 +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 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