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 21:20:05 +0000 (21:20 +0000)
commit816ac899a7087a79e1d23b5efe867987e6dc3233
tree50cf97b7450b13be62f0c24fa6991133431d6cc1
parenta3a9b8d440c10e0f1937b20d36cd9e1004843197
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