| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Bug: T389452
Change-Id: Id7a3f565821231647fe75a24e9ef7efeeb157c5d
|
|
|
|
|
| |
Bug: T353458
Change-Id: Ibe1810f1c71316a9124e1dc6ae405097dafd5267
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
User consultations uncovered a need for restricting blocks to a list of
more than 10 pages. With multiblocks, an admin in this situation could
split up the block into several blocks, each with 10 pages, which is a
tedious workaround. Discourage this by increasing the limit to 50.
This was already implemented on the client side.
Bug: T388505
Change-Id: I034b9e2fbf38e715255ca84065ec5a63534f86ad
|
|/
|
|
|
| |
Bug: T388097
Change-Id: I89baf1b190cf9adefba9a232f57c957a2345f8e5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's about 100 callers of the DatabaseBlock constructor in core
tests, most of them passing an address parameter which needs access to
the global service container to parse.
Many are passing the constructed object straight to
DatabaseBlockStore::insertBlock(). So add insertWithParams() for their
convenience, which has some handy shortcut parameters, has service
access, and throws on failure. The calling code tends to be shorter
than before.
For unit tests trying to construct DatabaseBlock objects without a
service container, direct construction of BlockTarget subclasses is
warranted. Add a default to the $wikiId parameters for their
convenience.
MockBlockManager had its own 'target' parameter, mixed in with block
options, carrying its own special idea of a target, which conflicted
with DatabaseBlock's new 'target' parameter. Harmonise the parameters
and fix the callers.
Bug: T382106
Bug: T385966
Change-Id: I78b45a6003b62962211379c36da5587081f90f00
|
|
|
|
|
|
|
|
| |
Add a regression test for accidental conversion of block log expiry
times from relative to absolute timestamps.
Bug: T248196
Change-Id: Ie7db802c43b222260074c01bf70a3e9759cef845
|
|
|
|
|
|
|
|
|
|
|
| |
A block action done with the API no longer shows the relative timestamp
in the log. So revert the parts of 257d6f3ba0517265471165cfdf4ba8576cc4
which switched ApiBlock to use ExpiryDef.
The change to errorformat is not reverted.
Bug: T248196
Change-Id: I3c277a5612e2c00d1120012354c4657c6fb02b47
|
|
|
|
|
|
|
|
|
|
|
| |
* Use the ExpiryDef validation for the action=block expiry parameter.
* Change the errorformat used by Special:Block to get validation
messages in HTML and the right language, and map these to form
error messages.
Bug: T384241
Bug: T248196
Change-Id: Ic7a080d02e317bbdddb609bf724e3c7c2c393983
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In ApiBlock:
* Add an "id" parameter. If this is given, update the specified block.
* Add a "newblock" parameter. If this is given, always add a new block,
don't check if the target is already blocked.
* If "reblock" is given and the target has more than one block, fail
with an "ambiguous-block" error.
Supporting changes:
* Add BlockUserFactory::newUpdateBlock(), which takes a DatabaseBlock
instead of a target union to act on. The block is passed through to
the BlockUser constructor.
* Rename the first parameter to BlockUser::placeBlock() from $reblock to
$conflictMode, and style it like an enum. Add the CONFLICT_NEW value,
to support the "newblock" API option.
* In DatabaseBlockStore::newFromId(), add $fromPrimary, so that ApiBlock
can pass data to BlockUserFactory with equivalent freshness to the
LHS.
Also:
* In BlockUser, memoize prior blocks loaded from the DB
* Move T287798 autoblock check to the memoized accessor. Just don't
return autoblocks.
* Move "TODO handle failure" comment in BlockUser to the called method.
It really can't fail.
* In DatabaseBlockStore::newFromId(), add an $includeExpired parameter
and default to false although it was previously implicitly true.
Based on a brief review of callers, I think this is beneficial.
Bug: T378147
Change-Id: Iea5b77cb27006b33f3dde61660be5ad2c374a425
|
|
|
|
|
|
|
|
|
|
|
| |
Implicitly marking parameter $... as nullable is deprecated in php8.4,
the explicit nullable type must be used instead
Created with autofix from Ide15839e98a6229c22584d1c1c88c690982e1d7a
Break one long line in SpecialPage.php
Bug: T376276
Change-Id: I807257b2ba1ab2744ab74d9572c9c3d3ac2a968e
|
|
|
|
|
| |
Bug: T353458
Change-Id: I3ea6b08c5018ba03ba45c5766e1f46e12f6b8597
|
|
|
|
|
|
|
|
|
|
| |
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.
Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.
Change-Id: I48014b6464f3e7e2b7f083e67f517af0b1a9367e
|
|
|
|
|
| |
Bug: T316841
Change-Id: I29e535e8ee9b5641a4546d53b98cd5060d39681d
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Deprecate and stop using $wgBlockTargetMigrationStage. Remove
block_target migration code.
* Make the $schema parameters to DatabaseBlockStore methods default to
SCHEMA_BLOCK. Avoid passing these parameters where possible.
* Remove cleanupBlocks.php
* Deprecate DatabaseBlock static methods which try to present the old
schema for b/c.
Bug: T362133
Change-Id: I845bad8cc09a4528fef46a6f9d490ebdec881d99
|
|
|
|
|
| |
Bug: T357823
Change-Id: I0d7cc2c9b166d5e5b913c1305f7cee017fe377af
|
|
|
|
| |
Change-Id: I5629f91387f2ac453ee4341bfe4bba310bd52f03
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
… replace them with the named convenience methods provided by
PHPUnit.
Change-Id: Ib46dbc3ab7926cf176477254f466b9bdd3be7c46
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Support migration stages when reading and writing blocks.
I tried to set it up for an easy next stage, in which support for the
old schema is removed. I tried to avoid factoring out of shared code
between the two schemas, so that the old schema cases can simply be
deleted without the need to revert unnecessary abstractions.
However, I added HideUserUtils to factor out ipb_deleted queries. Code
review showed that this was already quite complex, with multiple
approaches to the problem, so it benefits from refactoring even without
the schema abstraction.
HideUserUtils is a service rather than a standalone class to support
unit tests, since unit tests do not allow global config access. When
the migration stage config is removed, it will be a service with no
constructor parameters -- an unnecessary abstraction which should
ideally be resolved at that time.
When interpreting result rows, it is possible to share code by using
field aliases. But when constructing WHERE conditions, the actual field
names need to be used, so the migration is more intrusive in
ApiQueryBlocks and SpecialBlockList, where complex conditions are used.
Bug: T346293
Bug: T51504
Bug: T349883
Change-Id: I408acf7a57b0100fe18c455fc13141277a598925
|
|
|
|
|
| |
Bug: T342301
Change-Id: I5ea01f7ee103570165261bde0965c5b65e04c369
|
|
|
|
|
|
|
|
|
|
| |
* Migrate callers of DatabaseBlock methods newListFromTarget,
newFromID, newFromTarget, doAutoblock.
* Deprecate DatabaseBlock methods newFromID and getAutoblockExpiry.
These are the methods with no extension callers in code search.
Bug: T255433
Change-Id: If0358459f53d32e7fe984c2fb8b61e0088f28922
|
|
|
|
|
|
|
| |
Deprecated long time ago.
Bug: T330641
Change-Id: Ia57f12d350c3346029aafae25534c9ed262a7e98
|
|
|
|
|
| |
Bug: T344971
Change-Id: Ia69d82d6a6e623b9032240dc910fb47ff5887661
|
|
|
|
|
| |
Bug: T321882
Change-Id: I48c10343295c4eb3d9ef8037343b0070e928f040
|
|
|
|
|
|
|
| |
Replace User::, Title:: ContentHandler:: calls
to the corresponding services
Change-Id: I57e47221a00eafac9f171215019cf25e19e1808e
|
|
|
|
|
|
|
| |
Ideally we'd use Authority, but that doesn't always work, so just call
the getTest* methods directly.
Change-Id: I7f8393bb754beeb319b5555b5dac05265e376a22
|
|
|
|
|
|
|
|
|
|
| |
Same as I7a82951.
overrideConfigValue() and overrideConfigValues() both call
setMwGlobals(), which calls resetServices(). This is surprisingly
expensive. It's much better to call it once with an array.
Change-Id: I4ff2f6b902b1a1e0b554ce6fc76f3b612f703fae
|
|\ |
|
| |
| |
| |
| |
| | |
Bug: T311866
Change-Id: I0324919f4e40f4e2db3dab1e9aacf74177170b20
|
|/
|
|
|
|
|
|
|
|
| |
Do not assume that sysops don't have the hideuser right. That can be
changed in configuration. For instance, I have that in my local. Use an
appropriate authority without the 'hideuser' permission instead.
Also avoid overriding $wgGroupPermissions, and use an Authority instead.
Change-Id: I1c8b25965e41a1a0308dfbe0212c1c19deccb364
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Error messages are not guaranteed to be stable, and these tests
prevent us from improving them.
Error codes are supposed to be stable, so we should be asserting
that they do not change (especially since many of them are
dynamically generated by the dodgy code in ApiMessageTrait).
Introduce helpers assertApiErrorCode() and expectApiErrorCode()
to be used instead of the usual PHPUnit assertions/expectations
for this case.
Change-Id: I752f82f29bf5f9405ea117ebf9e5cf70335464ad
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Unnecessary regex modifier. I agree with this inspection which flags
/s modifiers on regexes that don't use a dot.
* Property declared dynamically.
* Unused local variable. But it's acceptable for an unused local
variable to take the return value of a method under test, when it is
being tested for its side-effects. And it's acceptable for an unused
local variable to document unused list expansion elements, or the
nature of array keys in a foreach.
Change-Id: I067b5b45dd1138c00e7269b66d3d1385f202fe7f
|
|
|
|
|
|
|
| |
This patch covers: tests/phpunit/includes/actions/ and
tests/phpunit/includes/api/.
Change-Id: I60d8fb7b8a63b423606db935fa0d24cf859b2512
|
|
|
|
| |
Change-Id: I38299cb65eeaadfdc0eb05db4e8c0b0119cfb37d
|
|
|
|
|
| |
Bug: T254646
Change-Id: Ib192dc5704a14d02c7c374d0ab29bac55c5df24a
|
|
|
|
|
|
|
|
|
|
|
| |
Removes deprecated API endpoints and modules for dealing with
CSRF tokens.
Note: i18n messages are removed in a followup for ease of revert.
Bug: T280806
Depends-On: Ic83f44587db119ff2e3e6d5ff33a10894e0695e7
Change-Id: I58aedec6942ac5d3c21574cb0072f00ef365098c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
composer:
* mediawiki/mediawiki-codesniffer: 36.0.0 → 37.0.0
The following sniffs now pass and were enabled:
* Generic.ControlStructures.InlineControlStructure
* MediaWiki.PHPUnit.AssertCount.NotUsed
npm:
* svgo: 2.3.0 → 2.3.1
* https://npmjs.com/advisories/1754 (CVE-2021-33587)
Change-Id: I2a9bbee2fecbf7259876d335f565ece4b3622426
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace all uses of AbstractBlock::getTarget with
Block ::getTargetName and ::getTargetUserIdentity.
Create AbstractBlockTest and two test cases for
AbstractBlock::getTarget and ::getTargetAndType.
It tests triggering of the deprecation warning.
Bug: T282247
Depends-On: I0543f363af66c57f5763b91320d87a69f23f9466
Change-Id: Iaeca824cac30172178de72f3cf7b7ae4cdd6f880
|
|
|
|
|
|
|
|
|
|
|
| |
This is a demo, a lot of tests could be rewritten as a followup
to pass proper Authority when executing tests instead of writing
globals. Much cleaner imho.
An improvement idea is to allow overriding 'default permissions'
when creating a mock Authority.
Change-Id: I38570024e0d5a67a8e1c52f7456c458090ec2b6e
|
|
|
|
|
|
|
| |
Identity only
Bug: T283641
Change-Id: Ic6d4a6e10bda0115c87a85d8a9ddfd4098cd1373
|
|
|
|
|
| |
Bug: T280522
Change-Id: I114e3c76cfb6dd2f79b5217aee4b3da34df00850
|
|
|
|
|
|
|
| |
Make the assertions per test more focussed and stop relying on
restrictions being in a certain order.
Change-Id: I75e8d8d44eb43b894f72503ead55bd95dc4b72bf
|
|
|
|
|
|
| |
Just an auto-replace from codesniffer for now.
Change-Id: I5240dc9ac5929d291b0ef1c743ea2bfd3f428266
|
|
|
|
|
|
|
|
|
| |
ConvertibleTimestamp::setFakeTime is the standard for this kind of
tests. This specific test just caused
f069704e517f749f3fd7de0f6e801c145e6cfab1 to fail the merge-and-submit,
which delayed other merges too.
Change-Id: I3fc92923fee7148f3b3dce610cdb21b1712c9982
|
|
|
|
|
|
|
|
|
|
|
| |
Most of these are found by the not yet released I10559d8.
I remove the type MockObject in some cases when the calling
code really does not need to know if he get's a mock or the
real thing. However, I do this only in places that are very
closely related to the fixes.
Change-Id: I26a4c3c5a8ae141bf56161b52b54bce7e68f2e30
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than having to do DatabaseBlock calls directly,
and then ManualLogEntry calls to facilitate logging,
let's create a BlockUser service, capable of blocking users
and logging, optionally with permission checking.
This should make blocking users easier for developers,
for instance, AbuseFilter or CheckUser can easily
benefit from this commit.
Bug: T189073
Change-Id: Ifdced735b694b85116cb0e43dadbfa8e4cdb8cab
|
|
|
|
|
|
|
|
|
| |
To ensure the functionality doesn't break as part of
Ifdced735b694b85116cb0e43dadbfa8e4cdb8cab,
which refactors the block handling
Bug: T189073
Change-Id: I7cb1be6532c5b32a4a77924c42483d43a290c464
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Following 23c3c70d7ff2, soft deprecate the static methods on
DatabaseBlock that have been moved to DatabaseBlockStore:
* ::insert
* ::delete
* ::update
* ::purgeExpired
Update calls to the deprecated methods from core.
Change-Id: I1272eb978594fd4f386bda12cbc24131ad7d882f
|
|
|
|
|
| |
Bug: T242912
Change-Id: Icf737140dd112dc4d222274ae40e225cb7a9d3fc
|