Revert "Revert "Title::checkUserBlock should call User::isBlockedFrom for every action""
authorTchanders <thalia.e.chan@googlemail.com>
Thu, 6 Dec 2018 20:35:40 +0000 (20:35 +0000)
committerDavid Barratt <dbarratt@wikimedia.org>
Mon, 7 Jan 2019 14:40:12 +0000 (09:40 -0500)
commit58938095e265f08c150bc80bd98e764d51cce160
tree8c5a7c24ba2154b99199786898ab76131bfcabdc
parent311b203f37eb55e9695542a6e58acce0fde9e248
Revert "Revert "Title::checkUserBlock should call User::isBlockedFrom for every action""

This reverts commit 91fc7480301c8b2404cc280511c2fc83a6c3aa5d.

Hence it reapplies I6312a36911e5b73d773452fefef7ff25b9af08a4.

The changes made by this commit are (excluding the cases
checked for earlier):
* An action can only be blocked if prevents() is true/null and
isBlockedFrom() is truthy. Previously, any action other than
'edit' or 'create' would be blocked if prevents() was true/null,
regardless of isBlockedFrom().
* If an Action can be constructed, and requiresUnblock() is
false, the action won't be blocked. Previously, requiresUnblock()
wasn't checked.

This commit was previously reverted because it exposed that
EditEntityAction::requiresUnblock in Wikibase wrongly returned
false (fixed in I99061230023da2bbd0f98190a2907ca2e9717a4c).
Other potentially similar cases were audited in T211048.

Bug: T208862
Change-Id: If74a1d422290b8c62b7a7a8922621c73c9598269
RELEASE-NOTES-1.33
includes/Title.php
languages/i18n/en.json
languages/i18n/qqq.json
tests/phpunit/includes/TitlePermissionTest.php