From: Reedy Date: Fri, 11 Oct 2019 23:36:47 +0000 (+0100) Subject: PermissionManager doesn't exist in 1.33, so we cannot use it in 1.31 X-Git-Tag: 1.31.5~2 X-Git-Url: http://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=3c22347f55102536b050160dfa9b30c21018fc2c 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 --- 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 );