mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-28 07:50:24 +00:00
AbuseFilter: Remove duplicate filter log link
For history action, the link would be already added by HistoryPageToolLinks hook, so it should not be duplicated by this hook. See images on https://phabricator.wikimedia.org/T261087#6430172 Change-Id: Ia8dd5be49d3ffb48f298ea287e0b2f98c3052015
This commit is contained in:
parent
c1b5a32159
commit
679c777c33
|
@ -697,10 +697,12 @@ class AbuseFilterHooks {
|
|||
LinkRenderer $linkRenderer,
|
||||
array &$links
|
||||
) {
|
||||
$user = $context->getUser();
|
||||
if ( MediaWikiServices::getInstance()->getPermissionManager()
|
||||
->userHasRight( $user, 'abusefilter-log' )
|
||||
) {
|
||||
$pm = MediaWikiServices::getInstance()->getPermissionManager();
|
||||
$show = $pm->userHasRight( $context->getUser(), 'abusefilter-log' );
|
||||
$action = $context->getRequest()->getVal( 'action', 'view' );
|
||||
|
||||
// For 'history action', the link would be added by HistoryPageToolLinks hook.
|
||||
if ( $show && $action !== 'history' ) {
|
||||
$links[] = $linkRenderer->makeLink(
|
||||
SpecialPage::getTitleFor( 'AbuseLog' ),
|
||||
$context->msg( 'abusefilter-log-linkonundelete' )->text(),
|
||||
|
|
Loading…
Reference in a new issue