SECURITY: API: Respect $wgBlockCIDRLimit in action=block
authorKunal Mehta <legoktm@member.fsf.org>
Fri, 13 Jul 2018 15:07:51 +0000 (08:07 -0700)
committerReedy <reedy@wikimedia.org>
Thu, 6 Jun 2019 16:54:15 +0000 (16:54 +0000)
commit756827cae7483b5aae7d45228e89ae4cfc203364
treed009da3543c0d2bebd9af323715b09e01460cff2
parent616525021b3691e30a980a42b837b7ad44ecfd09
SECURITY: API: Respect $wgBlockCIDRLimit in action=block

$wgBlockCIDRLimit states how large rangeblocks are allowed to be for IPv4
and IPv6. The API now calls SpecialBlock::validateTarget() to perform
that validation step.

As a minor thing, SpecialBlock::checkUnblockSelf() is now called twice by
the API, but that can probably be cleaned up at another time.

Tests included.

Bug: T199540
Change-Id: Ic7d60240d9ebd9580c0eb3b41e4befceab69bd81
includes/api/ApiBlock.php
tests/phpunit/includes/api/ApiBlockTest.php