From f136e4c2e60862ac465059e8eab39b54323a1555 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mat=C4=9Bj=20Such=C3=A1nek?= Date: Sat, 25 Feb 2017 15:01:34 +0000 Subject: [PATCH] Do not output invalid links for deleted names on Special:Contributions Steps to reproduce: - have advanced user rights and go to Special:Contributions - choose "Show contributions of new accounts only" and "Deleted only" - examine rows with deleted user names, marked with "[username or IP address removed - edit hidden from contributions]" All these rows have a red "(talk)" link which links to "User talk:" (that's all). More detailed examination reveals an empty element which is supposed to link to the user page. As these rows have the mentioned marker, we can just skip generating user link if the user name is hidden. Change-Id: I4fc7fb7ad2836834e9436ca2acb6b12484c15172 --- includes/specials/pagers/ContribsPager.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/includes/specials/pagers/ContribsPager.php b/includes/specials/pagers/ContribsPager.php index 47a2aed380..a4740a4c19 100644 --- a/includes/specials/pagers/ContribsPager.php +++ b/includes/specials/pagers/ContribsPager.php @@ -458,14 +458,13 @@ class ContribsPager extends ReverseChronologicalPager { } # Show user names for /newbies as there may be different users. - # Note that we already excluded rows with hidden user names. - if ( $this->contribs == 'newbie' ) { + # Note that only unprivileged users have rows with hidden user names excluded. + $userlink = ''; + if ( $this->contribs == 'newbie' && !$rev->isDeleted( Revision::DELETED_USER ) ) { $userlink = ' . . ' . $lang->getDirMark() . Linker::userLink( $rev->getUser(), $rev->getUserText() ); $userlink .= ' ' . $this->msg( 'parentheses' )->rawParams( - Linker::userTalkLink( $rev->getUser(), $rev->getUserText() ) )->escaped() . ' '; - } else { - $userlink = ''; + Linker::userTalkLink( $rev->getUser(), $rev->getUserText() ) )->escaped() . ' '; } $flags = []; -- 2.20.1