2008-06-27 06:18:51 +00:00
|
|
|
|
<?php
|
2009-10-07 13:57:06 +00:00
|
|
|
|
/**
|
2008-06-27 06:18:51 +00:00
|
|
|
|
* Automatically applies heuristics to edits.
|
|
|
|
|
*
|
2009-10-07 13:57:06 +00:00
|
|
|
|
* @file
|
|
|
|
|
* @ingroup Extensions
|
2008-06-27 06:18:51 +00:00
|
|
|
|
* @author Andrew Garrett <andrew@epstone.net>
|
|
|
|
|
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
|
2015-09-28 18:03:35 +00:00
|
|
|
|
* Includes GFDL-licensed images retrieved from
|
|
|
|
|
* http://commons.wikimedia.org/wiki/File:Yes_check.svg and
|
|
|
|
|
* http://commons.wikimedia.org/wiki/File:Red_x.svg -- both have been
|
|
|
|
|
* downsampled and converted to PNG.
|
2009-10-07 13:57:06 +00:00
|
|
|
|
* @link http://www.mediawiki.org/wiki/Extension:AbuseFilter Documentation
|
2008-06-27 06:18:51 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2016-05-15 11:12:40 +00:00
|
|
|
|
if ( function_exists( 'wfLoadExtension' ) ) {
|
|
|
|
|
wfLoadExtension( 'AbuseFilter' );
|
|
|
|
|
// Keep i18n globals so mergeMessageFileList.php doesn't break
|
|
|
|
|
$wgMessagesDirs['AbuseFilter'] = __DIR__ . '/i18n';
|
|
|
|
|
$wgExtensionMessagesFiles['AbuseFilterAliases'] = __DIR__ . '/AbuseFilter.alias.php';
|
|
|
|
|
/* wfWarn(
|
|
|
|
|
'Deprecated PHP entry point used for AbuseFilter extension. ' .
|
|
|
|
|
'Please use wfLoadExtension instead, ' .
|
|
|
|
|
'see https://www.mediawiki.org/wiki/Extension_registration for more details.'
|
|
|
|
|
); */
|
|
|
|
|
return;
|
|
|
|
|
} else {
|
2017-08-08 12:03:56 +00:00
|
|
|
|
die( 'This version of the AbuseFilter extension requires MediaWiki 1.29+' );
|
2016-05-15 11:12:40 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Global declarations and documentation kept for IDEs and PHP documentors.
|
|
|
|
|
// This code is never executed.
|
|
|
|
|
|
|
|
|
|
/**
|
2016-06-03 18:01:56 +00:00
|
|
|
|
* The possible actions that can be taken by abuse filters.
|
|
|
|
|
*
|
|
|
|
|
* @var array [action name => is enabled?] At the end of setup, false values will be filtered out
|
2016-05-15 11:12:40 +00:00
|
|
|
|
*/
|
2016-06-03 18:01:56 +00:00
|
|
|
|
$wgAbuseFilterActions = [ /* See extension.json */ ];
|
|
|
|
|
|
|
|
|
|
$wgAbuseFilterAvailableActions = 'REMOVED'; // use $wgAbuseFilterActions instead
|
2008-07-17 02:43:45 +00:00
|
|
|
|
|
2016-05-15 11:12:40 +00:00
|
|
|
|
/**
|
|
|
|
|
* The maximum number of 'conditions' that can be used each time the filters are run against a
|
|
|
|
|
* change. (More complex filters require more 'conditions').
|
|
|
|
|
*/
|
2009-01-23 19:23:19 +00:00
|
|
|
|
$wgAbuseFilterConditionLimit = 1000;
|
2008-07-17 02:43:45 +00:00
|
|
|
|
|
2016-05-15 11:12:40 +00:00
|
|
|
|
/**
|
|
|
|
|
* Disable filters if they match more than X edits, constituting more than Y%
|
|
|
|
|
* of the last Z edits, if they have been changed in the last S seconds.
|
|
|
|
|
*/
|
2012-10-23 13:14:34 +00:00
|
|
|
|
$wgAbuseFilterEmergencyDisableThreshold['default'] = 0.05;
|
2016-05-15 11:12:40 +00:00
|
|
|
|
/** @see $wgAbuseFilterEmergencyDisableThreshold */
|
2012-10-23 13:14:34 +00:00
|
|
|
|
$wgAbuseFilterEmergencyDisableCount['default'] = 2;
|
2016-05-15 11:12:40 +00:00
|
|
|
|
/** @see $wgAbuseFilterEmergencyDisableThreshold */
|
2012-10-23 13:14:34 +00:00
|
|
|
|
$wgAbuseFilterEmergencyDisableAge['default'] = 86400; // One day.
|
2008-07-31 16:28:24 +00:00
|
|
|
|
|
2016-05-15 11:12:40 +00:00
|
|
|
|
/** Abuse filter parser class */
|
2008-09-18 13:01:50 +00:00
|
|
|
|
$wgAbuseFilterParserClass = 'AbuseFilterParser';
|
2008-08-04 12:15:14 +00:00
|
|
|
|
|
2016-05-15 11:12:40 +00:00
|
|
|
|
/**
|
2016-06-03 18:01:56 +00:00
|
|
|
|
* Do users need "abusefilter-modify-restricted" user right as well as "abusefilter-modify"
|
|
|
|
|
* in order to create or modify filters which carry out this action?
|
|
|
|
|
*
|
|
|
|
|
* @var array action name => is restricted?
|
2016-05-15 11:12:40 +00:00
|
|
|
|
*/
|
2016-06-03 18:01:56 +00:00
|
|
|
|
$wgAbuseFilterRestrictions = [ /* See extension.json */ ];
|
|
|
|
|
|
|
|
|
|
$wgAbuseFilterRestrictedActions = 'REMOVED'; // use $wgAbuseFilterRestrictions instead
|
2009-03-22 10:34:54 +00:00
|
|
|
|
|
2016-05-15 11:12:40 +00:00
|
|
|
|
/**
|
|
|
|
|
* Allows to configure the extension to send hit notifications to Special:RecentChanges or UDP.
|
|
|
|
|
* Available options: rc, udp, rcandudp
|
|
|
|
|
* @var string|false
|
|
|
|
|
*/
|
2012-04-14 10:10:35 +00:00
|
|
|
|
$wgAbuseFilterNotifications = false;
|
2016-05-15 11:12:40 +00:00
|
|
|
|
|
|
|
|
|
/** Enable notifications for private filters */
|
2012-12-15 17:14:42 +00:00
|
|
|
|
$wgAbuseFilterNotificationsPrivate = false;
|
2009-03-30 06:12:12 +00:00
|
|
|
|
|
2016-05-15 11:12:40 +00:00
|
|
|
|
/** Name of a database where global abuse filters will be stored in */
|
2009-03-30 06:12:12 +00:00
|
|
|
|
$wgAbuseFilterCentralDB = null;
|
2016-05-15 11:12:40 +00:00
|
|
|
|
/** Set this variable to true for the wiki where global AbuseFilters are stored in */
|
2009-03-30 06:12:12 +00:00
|
|
|
|
$wgAbuseFilterIsCentral = false;
|
|
|
|
|
|
2016-05-15 11:12:40 +00:00
|
|
|
|
/**
|
|
|
|
|
* Disallow centralised filters from taking actions that locally
|
|
|
|
|
* block, remove from groups, or revoke permissions
|
|
|
|
|
*/
|
2012-08-03 21:55:35 +00:00
|
|
|
|
$wgAbuseFilterDisallowGlobalLocalBlocks = false;
|
|
|
|
|
|
2016-05-15 11:12:40 +00:00
|
|
|
|
/** Block duration for logged in users */
|
2009-06-03 15:52:53 +00:00
|
|
|
|
$wgAbuseFilterBlockDuration = 'indefinite';
|
2016-05-15 11:12:40 +00:00
|
|
|
|
/** Block duration for anonymous users ($wgAbuseFilterBlockDuration will be used if null) */
|
2013-02-22 23:20:29 +00:00
|
|
|
|
$wgAbuseFilterAnonBlockDuration = null;
|
2011-11-06 01:15:55 +00:00
|
|
|
|
|
2016-05-15 11:12:40 +00:00
|
|
|
|
/** Callback functions for custom actions */
|
|
|
|
|
$wgAbuseFilterCustomActionsHandlers = [];
|
2012-05-06 06:44:45 +00:00
|
|
|
|
|
2016-05-15 11:12:40 +00:00
|
|
|
|
/**
|
|
|
|
|
* The list of "groups" filters can be divided into – used for applying edit filters to certain
|
|
|
|
|
* types of actions. By default there is only one group.
|
|
|
|
|
*/
|
|
|
|
|
$wgAbuseFilterValidGroups = [ 'default' ];
|
2012-06-06 05:18:31 +00:00
|
|
|
|
|
2016-05-15 11:12:40 +00:00
|
|
|
|
/** Default warning messages, per filter group */
|
|
|
|
|
$wgAbuseFilterDefaultWarningMessage = [ /* See extension.json */ ];
|
2013-08-27 17:00:27 +00:00
|
|
|
|
|
2016-05-15 11:12:40 +00:00
|
|
|
|
/**
|
|
|
|
|
* Age used as cutoff when purging old IP log data.
|
|
|
|
|
* Used by maintenance script purgeOldLogIPData.php
|
|
|
|
|
*/
|
2015-09-28 18:03:35 +00:00
|
|
|
|
$wgAbuseFilterLogIPMaxAge = 3 * 30 * 24 * 3600; // 3 months
|
2016-04-08 16:22:39 +00:00
|
|
|
|
|
2016-05-15 11:12:40 +00:00
|
|
|
|
/**
|
|
|
|
|
* Whether to record the average time taken and average number of conditions used by each filter.
|
|
|
|
|
*/
|
2016-04-08 16:22:39 +00:00
|
|
|
|
$wgAbuseFilterProfile = false;
|
2017-08-24 14:52:49 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Whether to record runtime metrics for all filters combined.
|
|
|
|
|
*/
|
|
|
|
|
$wgAbuseFilterRuntimeProfile = false;
|