Merge "Remove usage of User::isBlockedGlobally and User::getGlobalBlock"

This commit is contained in:
jenkins-bot 2022-11-16 15:22:09 +00:00 committed by Gerrit Code Review
commit a584e73975
2 changed files with 2 additions and 4 deletions

View file

@ -24,7 +24,7 @@
"license-name": "MIT", "license-name": "MIT",
"type": "editor", "type": "editor",
"requires": { "requires": {
"MediaWiki": ">= 1.39.0" "MediaWiki": ">= 1.40.0"
}, },
"callback": "MediaWiki\\Extension\\VisualEditor\\Hooks::onRegistration", "callback": "MediaWiki\\Extension\\VisualEditor\\Hooks::onRegistration",
"ServiceWiringFiles": [ "ServiceWiringFiles": [

View file

@ -581,9 +581,7 @@ class ApiVisualEditor extends ApiBase {
$block = null; $block = null;
$blockinfo = null; $blockinfo = null;
// Blocked user notice // Blocked user notice
if ( $user->isBlockedGlobally() ) { if ( $permissionManager->isBlockedFrom( $user, $title, true ) ) {
$block = $user->getGlobalBlock();
} elseif ( $permissionManager->isBlockedFrom( $user, $title, true ) ) {
$block = $user->getBlock(); $block = $user->getBlock();
} }
if ( $block ) { if ( $block ) {