Extension:AbuseFilter/zh

滥用过滤器（AbuseFilter）扩展允许具有权限的用户设置当用户的操作（例如编辑）匹配特定标准时，要进行的特定動作.

例如，可以创建一个过滤器防止匿名用户添加外部链接或封禁移除超过2000个字符的用户.

用户权限
一旦您安装了此扩展，您将需要在"LocalSettings.php"设置用户权限.

举个例子，如果按照以下配置的话，管理员能对滥用过滤器做任何设定，而任何人都能查看过滤日志和已公开的过滤器过滤代码：

参数

 * Emergency throttling

AbuseFilter comes with a feature that automatically throttles (disable) filters that have been edited recently and match a certain theresold of the latest actions.

This is done to prevent harmful edits on the filters to block every user that performs an action on the wiki or similar.

The condition to disable the filter depend on those variables:
 * - Percent of matches over the total amount of actions in the observed period.
 * - Count of matches of the filter in the observed period.
 * - Age of the filter to take it into account. If the last edit of the filter is older than this number of seconds, the filter won't be throttled, unless it's already throttled.
 * - Maximum number of recent actions to count against the threshold. Note that each action increments a counter, and once this counter reaches this configured value, this counter and the number of recent actions that matches all filters are reset to 0.

Throttled filters can be identified in the list of filters (Special:AbuseFilter) with the state,. Throttling happens silently, and there's no way to see when a filter got throttled.

When a filter gets throttled, it doesn't perform any dangerous action (the ones specified in ), and only "safe" actions are allowed. Throttled filters don't get enabled automatically. To disable the throttling, you need to edit the filter. Note that you need to actually change something from the filter: changing somethin from the filter's notes is sufficient.

Note that editing the filter updates its age, and can cause it to be disabled if it reaches again the conditions to be throttled in a short period since the last edit, leading to a unusable filter if your wiki has more abuse edits than legitimate ones. Filters can also get randomly throttled if the action count reaches, causing all filter matches count to reset to 0, and then someone repeatedly makes a filter to hit.

创建和管理过滤器
当安装好本插件，通过滥用管理器管理页Special:AbuseFilter查看过滤日志和创建、修改、测试、删除过滤器.


 * 规则格式——如何写一段过滤器的基础
 * 動作
 * 全域规则
 * 关于比较操作上限的指导手册
 * 要从维基百科导入过滤器：当您安装此扩展后，前往w:zh:Special:AbuseFilter选择一个过滤器（例如w:zh:Special:AbuseFilter/3），然后点击“导出此过滤器至其他wiki”，复制文本，前往您wiki的“Special:AbuseFilter/import”，粘贴文本.

API
滥用过滤器有两个API的list模块，一个用于获得过滤器列表（“abusefilters”），另一个用于获得过滤日志. 过滤日志是孤立于其他MediaWiki日志的（日志名为“abuselog”）. 不能通过API创建或修改滥用过滤器.

list = abusefilters
列出关于过滤器的信息


 * 参数:
 * - 从该过滤器ID开始列举
 * - 列举到该过滤器ID为止
 * - 列举的方向（older、newer）
 * - 只显示符合对应属性的过滤器（enabled|!enabled|deleted|!deleted|private|!private）
 * - 每次列举最大数量
 * - 欲获取的属性（id|description|pattern|actions|hits|comments|lasteditor|lastedittime|status|private）

如果过滤器是非公开的且您没有查看它的权限， 中某些参数则不会显示.


 * 例子:

list = abuselog
列出过滤器的触发日志.


 * 参数:
 * - 从该时间戳开始列举
 * - 列举到该时间戳为止
 * - 列举的方向（older、newer）
 * - 只显示该用户或IP地址触发过滤器的日志.
 * - 只显示该页面中触发过滤器的日志.
 * - 只显示该过滤器ID的触发日志
 * - 每次列举最大数量
 * - 欲获取的属性（ids|user|title|action|result|timestamp|details）


 * 例子:

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 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)

参见

 * 多个启用了的基金会wiki（带配置）