Move cookie-blocking methods to BlockManager
authorThalia <thalia.e.chan@googlemail.com>
Thu, 6 Jun 2019 18:00:20 +0000 (14:00 -0400)
committerThalia <thalia.e.chan@googlemail.com>
Tue, 11 Jun 2019 14:08:21 +0000 (15:08 +0100)
commitc5991f614ff3183ca4272ea33b08ec87e779a786
tree2ab4364a112072270ee03bfadc9c5753dfd2d3d1
parenteecc04472a0050093928bc48e0c789e99ce93e65
Move cookie-blocking methods to BlockManager

Move the cookie blocking logic into one place. Specifically, move
these methods to the BlockManager:
* User::trackBlockWithCookie
* DatabaseBlock::setCookie
* DatabaseBlock::clearCookie
* DatabaseBlock::getCookieValue
* DatabaseBlock::getIdFromCookieValue
* AbstractBlock::shouldTrackWithCookie

After this, BlockManager::trackBlockWithCookie should be called to
track a block, and BlockManager::clearBlockCookie should be called
to unset the cookie. The other methods in the above list are
helper methods that are made private or marked internal.

Also update places in core that call User::trackBlockWithCookie to
BlockManager::trackBlockWithCookie

Bug: T225141
Change-Id: I818962c6932c01c841a549a101637e00a7593e48
RELEASE-NOTES-1.34
includes/EditPage.php
includes/ServiceWiring.php
includes/block/AbstractBlock.php
includes/block/BlockManager.php
includes/block/DatabaseBlock.php
includes/specials/SpecialCreateAccount.php
includes/user/User.php
tests/phpunit/includes/block/BlockManagerTest.php
tests/phpunit/includes/user/UserTest.php