diff --git a/includes/ApiVisualEditor.php b/includes/ApiVisualEditor.php index 08410adb4e..32457c3ff1 100644 --- a/includes/ApiVisualEditor.php +++ b/includes/ApiVisualEditor.php @@ -485,10 +485,15 @@ class ApiVisualEditor extends ApiBase { /* allow IP users*/ false ); - if ( - !( $targetUser && $targetUser->isLoggedIn() ) && - !User::isIP( $targetUsername ) + $targetUserExists = ( $targetUser && $targetUser->isLoggedIn() ); + if ( $targetUserExists && $targetUser->isHidden() && + !$user->isAllowed( 'hideuser' ) ) { + // If the user exists, but is hidden, and the viewer cannot see hidden + // users, pretend like they don't exist at all. See T120883/T270453 + $targetUserExists = false; + } + if ( !$targetUserExists && !User::isIP( $targetUsername ) ) { // User does not exist $notices[] = "
\n" . $this->msg( 'userpage-userdoesnotexist', wfEscapeWikiText( $targetUsername ) ) .