dispatchUser() should use a 302 http status code
[lhc/web/wiklou.git] / includes / specials / SpecialRedirect.php
index c1409ff..82d8b73 100644 (file)
@@ -83,9 +83,16 @@ 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' )
+               ) {
+                       throw new PermissionsError( null, [ 'badaccess-group0' ] );
+               }
                $userpage = Title::makeTitle( NS_USER, $username );
 
-               return Status::newGood( $userpage->getFullURL( '', false, PROTO_CURRENT ) );
+               return Status::newGood( [
+                       $userpage->getFullURL( '', false, PROTO_CURRENT ), 302
+               ] );
        }
 
        /**