Commit graph

6 commits

Author SHA1 Message Date
Matěj Suchánek
1902efbcc7 BlockUser: Restore blocking autoblocked IP addresses
This seems to be a regression from 166ed5c.
DatabaseBlock::newFromTarget may return an autoblock for an IP
unless there is an existing manual block. If so, ignore it
because it is allowed to have an IP address both manually
blocked and autoblocked (see ipb_address_unique index).

Also add an integration test case.

Bug: T287798
Change-Id: I7c9a66ba0ffe759f43f4d0821c30fb94649d3dea
2021-08-03 14:49:41 +00:00
libraryupgrader
5357695270 build: Updating dependencies
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
2021-07-22 03:36:05 +00:00
Matěj Suchánek
166ed5cd95 BlockUser: Provide correct information to the post-block hook
Previously, BlockUser::placeBlockInternal attempted to insert
the new block with possible failure due to an existing block.
Regardless of the result, it would then retrieve the current
block which could be the just now inserted block. This one
was treated as the prior block and incorrectly provided to
the hook as such.

Refactor the method a little by retrieving the prior block
before attempting to insert a new one to make it more
efficient and to ensure the hook will have the correct value
for the prior block.

Change-Id: I70480ce32545f28f8317bb58f9c724d64cc54ccf
2021-07-17 12:26:14 +02:00
STran
2d3243b76b Don't allow blocking on pages that don't exist
Bug: T269341
Change-Id: I5836d72960c3f9df874ac3348602e3f8e6322afa
2021-04-08 07:44:53 -07:00
Petr Pchelko
c04328bdef Convert (Un)BlockUser to Authority
Change-Id: I5084b5523f15b7d55b2f5dc67ae19ec7059799ad
2021-03-18 02:10:45 +00:00
Martin Urbanec
c0fa9076f2 [tests] Move BlockUserTest to integration subfolder
The test extends MediaWikiIntegrationTestCase, so it belongs
here.

Change-Id: I6c69882ca6be594cd806a30eab3ea71a168a4ba9
2020-09-23 16:29:34 +02:00
Renamed from tests/phpunit/includes/block/BlockUserTest.php (Browse further)