呢個AbuseFilter 擴充功能俾有特權嘅用戶to set specific actions to be taken when actions by users, such as edits, match certain criteria。
For example, a filter could be created to prevent anonymous users from adding external links, or to block a user who removes more than 2000 characters.

Installation

Run the update script which will automatically create the necessary database tables that this extension needs.

YDone - Navigate to Special:Version on your wiki to verify that the extension is successfully installed.

To users running MediaWiki 1.26 or earlier:

The instructions above describe the new way of installing this extension using wfLoadExtension() If you need to install this extension on these earlier versions (MediaWiki 1.26 and earlier), instead of wfLoadExtension( 'AbuseFilter' );, you need to use:

require_once"$IP/extensions/AbuseFilter/AbuseFilter.php";

User rights

Once you installed the extension, you'll have to set up the user rights in LocalSettings.php.

Right

Description

abusefilter-modify

改濫用過濾器

abusefilter-view

睇濫用過濾器

abusefilter-log

去睇濫用紀錄

abusefilter-log-detail

去睇濫用紀錄細節

abusefilter-private

去睇濫用紀錄裏面嘅資料

abusefilter-modify-restricted

用限制動作改濫用過濾器

abusefilter-modify-global

Create or modify global abuse filters

abusefilter-revert

復原一個濫用過濾器嘅全部修改

abusefilter-view-private

睇一個私密嘅過濾器

abusefilter-log-private

View log entries of abuse filters marked as private

abusefilter-hide-log

Hide entries in the abuse log

abusefilter-hidden-log

View hidden abuse log entries

For example, the following sample configuration would allow sysops to do everything they want with AbuseFilter, and everyone to view the log and see public filter settings:

To import filters from Wikipedia: When you have installed the extension, go to w:Special:AbuseFilter, choose a filter (say w:Special:AbuseFilter/3), then click "Export this filter to another wiki", copy the text, go to "Special:AbuseFilter/import" on your wiki, paste the text.

The maximum number of 'conditions' that can be used each time the filters are run against a change. (More complex filters require more 'conditions').

$wgAbuseFilterValidGroups

'default'

The list of "groups" filters can be divided into. By default there is only one group.

$wgAbuseFilterEmergencyDisableThreshold

array( 'default' => 0.05 )

Disable a filter if it matched more than 2 edits, constituting more than 5 % of the actions which were checked against the filter's group in the "observed" period (at most one day), unless the filter has been changed in the last 86400 seconds (one day)

Age used as cutoff when purging old IP log data. Defaults to 3 months. Used by maintenance script purgeOldLogIPData.php.

$wgAbuseFilterProfile

false

MediaWiki version:

≥ 1.27

Whether to record data about the performance of filters – the average number of conditions used and the time consumed by every filter.

(This was always enabled in MediaWiki up to 1.25, then entirely removed from 1.26 for performance reasons, then restored in 1.27.)

$wgAbuseFilterRuntimeProfile

false

Whether to calculate and record the total runtime, conditions, and matched filters on each execution.

API

AbuseFilter adds two API list modules, one for details of abuse filters ("abusefilters") and one for the abuse log, since it is separate from other MediaWiki logs ("abuselog"). It is not possible to create or modify abuse filters using the API.

list = abusefilters

List information about filters

Parameters

abfstartid: The filter id to start enumerating from

abfendid: The filter id to stop enumerating at

abfdir: The direction in which to enumerate (older, newer)

abfshow: Show only filters which meet these criteria (enabled|!enabled|deleted|!deleted|private|!private)

abflimit: The maximum number of filters to list

abfprop: Which properties to get (id|description|pattern|actions|hits|comments|lasteditor|lastedittime|status|private)

When filters are private, some of the properties specified with abfprop will be missing unless you have the appropriate user rights.

Possible errors

Some users might experience that creating new filters or modifying old filters fail and the user just gets redirected to the original page. If the Wiki is using SSL certificates, this error could possibly be because of the $wgServer value, which might be using "http://" instead of "https://". An indication of this error will be, the browser giving https warning for Special:AbuseFilter pages. (Topic:T23dyyih0ofjada5)

See also

This extension is being used on one or more Wikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia's CommonSettings.php and InitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki's Special:Version page.