- if ( $rev->isDeleted( Revision::DELETED_USER ) && $isPublic ) {
- $link = wfMessage( 'rev-deleted-user' )->escaped();
- } elseif ( $rev->userCan( Revision::DELETED_USER ) ) {
- $userId = $rev->getUser( Revision::FOR_THIS_USER );
- $userText = $rev->getUserText( Revision::FOR_THIS_USER );
- $link = self::userLink( $userId, $userText )
- . self::userToolLinks( $userId, $userText, false, 0, null,
- $useParentheses );
- } else {
+ if ( $rev->userCan( RevisionRecord::DELETED_USER ) &&
+ ( !$rev->isDeleted( RevisionRecord::DELETED_USER ) || !$isPublic )
+ ) {
+ $userId = $rev->getUser( RevisionRecord::FOR_THIS_USER );
+ $userText = $rev->getUserText( RevisionRecord::FOR_THIS_USER );
+ if ( $userId || (string)$userText !== '' ) {
+ $link = self::userLink( $userId, $userText )
+ . self::userToolLinks( $userId, $userText, false, 0, null,
+ $useParentheses );
+ }
+ }
+
+ if ( !isset( $link ) ) {