Merge "SECURITY: Add permission check for suppressed account" into REL1_31
authorJforrester <jforrester@wikimedia.org>
Wed, 21 Aug 2019 16:57:32 +0000 (16:57 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 21 Aug 2019 16:57:32 +0000 (16:57 +0000)
includes/specials/SpecialRedirect.php

index e827911..8006048 100644 (file)
@@ -79,6 +79,11 @@ class SpecialRedirect extends FormSpecialPage {
                if ( $user->isAnon() ) {
                        return null;
                }
+               if ( $user->isHidden() && !MediaWikiServices::getInstance()->getPermissionManager()
+                       ->userHasRight( $this->getUser(), 'hideuser' )
+               ) {
+                       throw new PermissionsError( null, [ 'badaccess-group0' ] );
+               }
                $userpage = Title::makeTitle( NS_USER, $username );
 
                return $userpage->getFullURL( '', false, PROTO_CURRENT );