From 3c22347f55102536b050160dfa9b30c21018fc2c Mon Sep 17 00:00:00 2001 From: Reedy Date: Sat, 12 Oct 2019 00:36:47 +0100 Subject: [PATCH] PermissionManager doesn't exist in 1.33, so we cannot use it in 1.31 Followup T230402, PermissionManager doesn't exist until 1.33, so fix the backported patches to use User::isAllowed() instead. Change-Id: Ia73bf71293d67f97fb5086ffc0384307568d4d43 --- RELEASE-NOTES-1.31 | 2 ++ includes/specials/SpecialRedirect.php | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES-1.31 b/RELEASE-NOTES-1.31 index c2bb33412f..10cc2e6497 100644 --- a/RELEASE-NOTES-1.31 +++ b/RELEASE-NOTES-1.31 @@ -3,6 +3,8 @@ THIS IS NOT A RELEASE YET === Changes since MediaWiki 1.31.4 === +* Followup T230402, PermissionManager doesn't exist until 1.33, so fix the + backported patches to use User::isAllowed() instead. == MediaWiki 1.31.4 == diff --git a/includes/specials/SpecialRedirect.php b/includes/specials/SpecialRedirect.php index 7eba0ded23..27176c4233 100644 --- a/includes/specials/SpecialRedirect.php +++ b/includes/specials/SpecialRedirect.php @@ -81,9 +81,7 @@ class SpecialRedirect extends FormSpecialPage { // Message: redirect-not-exists return Status::newFatal( $this->getMessagePrefix() . '-not-exists' ); } - if ( $user->isHidden() && !MediaWikiServices::getInstance()->getPermissionManager() - ->userHasRight( $this->getUser(), 'hideuser' ) - ) { + if ( $user->isHidden() && !$this->getUser()->isAllowed( 'hideuser' ) ) { throw new PermissionsError( null, [ 'badaccess-group0' ] ); } $userpage = Title::makeTitle( NS_USER, $username ); -- 2.20.1