Extension:SpamRegex/zh
发行状态: 稳定版 |
|
|---|---|
| 实现 | 特殊页面 |
| 描述 | Adds a special page to filter out unwanted expressions. |
| 作者 | |
| 最新版本 | 1.9 |
| MediaWiki | 1.43+ |
| 数据库更改 | 是 |
| 许可协议 | GNU通用公眾授權條款2.0或更新版本 |
| 下載 | |
|
|
| 前往translatewiki.net翻譯SpamRegex扩展 | |
| 問題 | 开启的任务 · 报告错误 |
The SpamRegex extension creates a new page, "Special:SpamRegex", to filter out unwanted links or text. A full list of currently blocked links or text can be viewed on this same special page. The spamregexed expressions cannot be used in page content, edit summaries or page move summaries, depending on what was chosen by the user who blocked links or text.
Installation
- 下载文件,并解压
SpamRegex文件夹到extensions/目录中。
开发者和代码贡献人员应改从Git安装此扩展,输入:cd extensions/ git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/SpamRegex
- 請新增下列代码到您的LocalSettings.php文件的底部:
wfLoadExtension( 'SpamRegex' );
- 請运行更新脚本,它将自动创建此扩展所必须的数据库表。
- This extension uses 内存缓存 - please check if Memcached is configured properly in Global/LocalSettings.php.
- Ensure the
spamregexuser right is given to a group that exists; by default this user right is given to thestaffuser group (which does not exist in a default MediaWiki installation).
完成 – 請导航至您的wiki上的Special:Version,以验证此扩展已成功安装。
Usage
- Go to "Special:SpamRegex"
- Enter the phrase to be blocked into the "Phrase to block" box
- Supply a reason for blocking the phrase
- Select one or both of the available options: block phrase in page text & block phrase in summary (edit summaries, page move summaries)
- Press the "Block this phrase" button
Interoperability
SpamRegex also supports checking content submitted via the following extensions for spam:
- ArticleFeedbackv5 (AFTv5)
- Comments
- ProblemReports (ShoutWiki)
Note that none of these extensions use the ContentHandler or Content classes defined in MediaWiki core, for better or for worse.
See the hooked functions in /extensions/SpamRegex/includes/backend/SpamRegexHooks.php for an idea of how to add support for another custom extension.
The basic idea is simple: get the desired data from SpamRegex (call SpamRegex::fetchRegexData() with either SpamRegex::TYPE_TEXTBOX or SpamRegex::TYPE_SUMMARY as the parameter), ensure that you got something, iterate over the array and use PHP's preg_match() to detect a match.
In case of a match, signal this to the consumer code by e.g. returning a boolean so that the consumer knows that the submission is spam and should not be saved.
See also
- Stable extensions/zh
- Special page extensions/zh
- GPL licensed extensions/zh
- Extensions in Wikimedia version control/zh
- Comments::isSpam extensions/zh
- EditFilter extensions/zh
- LoadExtensionSchemaUpdates extensions/zh
- MovePageCheckPermissions extensions/zh
- ProblemReportsContentCheck extensions/zh
- RenameUserComplete extensions/zh
- All extensions/zh
- Extensions by Fandom/zh
- Extensions by ShoutWiki/zh
- Spam management extensions/zh
