diff --git a/includes/AbuseFilterHooks.php b/includes/AbuseFilterHooks.php index ff91234b9..6783a69c1 100644 --- a/includes/AbuseFilterHooks.php +++ b/includes/AbuseFilterHooks.php @@ -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(),