From 7863afffd060404495d0c0888b0448cc78f669a1 Mon Sep 17 00:00:00 2001 From: umherirrender Date: Tue, 19 Mar 2013 21:06:17 +0100 Subject: [PATCH] Remove (edit) from Special:Tags for non-editinterface users bug: 46180 Change-Id: I5106428b78ebdeeda4afe6fd07fba4e1e264dd18 --- includes/specials/SpecialTags.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/includes/specials/SpecialTags.php b/includes/specials/SpecialTags.php index 6d16103150..026b936bcc 100644 --- a/includes/specials/SpecialTags.php +++ b/includes/specials/SpecialTags.php @@ -68,20 +68,25 @@ class SpecialTags extends SpecialPage { return ''; } + $user = $this->getUser(); $newRow = ''; $newRow .= Xml::tags( 'td', null, Xml::element( 'code', null, $tag ) ); $disp = ChangeTags::tagDescription( $tag ); - $disp .= ' '; - $editLink = Linker::link( Title::makeTitle( NS_MEDIAWIKI, "Tag-$tag" ), $this->msg( 'tags-edit' )->escaped() ); - $disp .= $this->msg( 'parentheses' )->rawParams( $editLink )->escaped(); + if ( $user->isAllowed( 'editinterface' ) ) { + $disp .= ' '; + $editLink = Linker::link( Title::makeTitle( NS_MEDIAWIKI, "Tag-$tag" ), $this->msg( 'tags-edit' )->escaped() ); + $disp .= $this->msg( 'parentheses' )->rawParams( $editLink )->escaped(); + } $newRow .= Xml::tags( 'td', null, $disp ); $msg = $this->msg( "tag-$tag-description" ); $desc = !$msg->exists() ? '' : $msg->parse(); - $desc .= ' '; - $editDescLink = Linker::link( Title::makeTitle( NS_MEDIAWIKI, "Tag-$tag-description" ), $this->msg( 'tags-edit' )->escaped() ); - $desc .= $this->msg( 'parentheses' )->rawParams( $editDescLink )->escaped(); + if ( $user->isAllowed( 'editinterface' ) ) { + $desc .= ' '; + $editDescLink = Linker::link( Title::makeTitle( NS_MEDIAWIKI, "Tag-$tag-description" ), $this->msg( 'tags-edit' )->escaped() ); + $desc .= $this->msg( 'parentheses' )->rawParams( $editDescLink )->escaped(); + } $newRow .= Xml::tags( 'td', null, $desc ); $hitcount = $this->msg( 'tags-hitcount' )->numParams( $hitcount )->escaped(); -- 2.20.1