titleblacklist is not part of action=query (since a2f5ccd2 back in 2011)
and should not follow that naming schema.
No class alias as nobody needs to call the class directly
Change-Id: If57e5bd9291a894edf42835fed07d37cd8e8abed
We generally do not put these instructions in every test. A README file
would be more appropriate, but since there isn't one, I'm not sure if
it's needed, especially because the instructions for running tests
should ideally be the same for all extensions, and those could be
documented in a single place.
In particular, remove reference to soon-to-be-deprecated phpunit.php and
other information that can easily be found in the first 10 lines of
code.
Bug: T90875
Change-Id: I97e6f608f8a3f11febf33c38811fe7692be59e24
E.g. reducing deep indention and code duplication. Removing comments
that literally repeat what the code says.
The goal is to make the code easier to read and to maintain in the
future. I hope this is the case.
Change-Id: I6f23bc61ffb8b6d42ec697fec91bb6c92152561f
According to the discussions at Bug T254649 and Bug T254646
rename the lists to generic "allowed titles" and "disallowed titles"
lists.
The previous change was abandoned, probably because it tried
to say "blocklist", which can be confused for user blocking.
I see there is intention to merge this extension's functionality
into AbuseFilter, but until it happens, it would be nice
to rephrase the user-visible messages at least.
Also make the spelling of "username" and "case-insensitive" consistent
with core MediaWiki, and a few other copy editing fixes,
and fix some tests with these words.
Bug: T254650
Change-Id: I05ccc585325eb1610dd6b257a0b96ab43b0c8c8f
Since AbstractAuthenticationProvider ::setLogger, ::setManager,
::setConfig, ::setHookContainer methods had been soft deprecated,
so its usages were removed. AuthenticationProviderTestTrait
::initProvider was used in order to initialize
TitleBlacklistPreAuthenticationProvider in the test.
* Also bump required MW version to 1.37.0
Bug: T281994
Change-Id: I15b811a8596addad7a50b13d978851ebd86da9a5
Since no user was passed, it defaults to the test sysop, and no
replacement is needed
Bug: T244039
Change-Id: Idbfcbcded52566218b70ae644f61cf2dcc2c7f11
This global from MediaWiki was removed in 854a462 in 2016 but we didn't
clean up after it at the time.
Change-Id: I48f5d104e5350bd2ac170afc155015b8060e2ed5
It's shorter, and allows us to take advantage of any future improvements
to setGroupPermissions, such as automatically resetting affected
services.
Change-Id: Ie2d1ea65c0cb334bbde1666d00781474b7ac4dab
The test suite set $wgTitleBlacklistSources with a fixture source of
directories. Unfortunately when running tests from MediaWiki core the
TitleBlacklist has already been set with empty value and thus setting
the global is a noop.
That later causes a test to fail because the blacklist is emtpy.
Add TitleBlacklistTest::destroySingleton() so a test can reset the
singleton when changing $wgTitleBlacklistSources.
Since that is solely for testing, throw an exception unless we had
MW_PHPUNIT_TEST defined.
Bug: T155980
Change-Id: I99c3185811ed7b2225953fa6960096985e97c4d2
I guess this only ever worked before because none of the other tests
depended on these globals. Now that AuthManager is enabled by default,
one does.
Change-Id: If335fcc9b844a518b2c56bfa39153159261ae314
Introduces a new "antispoof" parameter. If set, try to normalize
the title using the AntiSpoof extension.
Bug: 53901
Change-Id: I9b3c5f5f5d9eeda65562fd83e21c9c2ba97e5569
* 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
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