From: umherirrender Date: Tue, 19 Mar 2013 20:06:17 +0000 (+0100) Subject: Remove (edit) from Special:Tags for non-editinterface users X-Git-Tag: 1.31.0-rc.0~20245^2 X-Git-Url: http://git.cyclocoop.org/%22.%24redirect_annul.%22?a=commitdiff_plain;h=7863afffd060404495d0c0888b0448cc78f669a1;p=lhc%2Fweb%2Fwiklou.git Remove (edit) from Special:Tags for non-editinterface users bug: 46180 Change-Id: I5106428b78ebdeeda4afe6fd07fba4e1e264dd18 --- 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();