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:
Ammar Abdulhamid 2020-09-02 18:20:01 +01:00
parent c1b5a32159
commit 679c777c33

View file

@ -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(),