This page is a translated version of the page Extension:AntiSpoof and the translation is 56% complete.
Other languages:
English • ‎español • ‎polski • ‎русский • ‎中文 • ‎日本語 • ‎한국어
OOjs UI icon advanced.svg
发布状态: 稳定版
Spoofing attempt.png
实现 用戶活動
描述 防止创建混淆的用户名。
作者 Brion Vibber (Brion VIBBERtalk)
兼容性方针 发行分支
MediaWiki 1.25+
表格 spoofuser
许可协议 GNU通用公眾授權條款2.0或更新版本
  • $wgAntiSpoofAccounts
  • $wgAntiSpoofBlacklist
问题 开放的工作 · 报告错误

AntiSpoof是防止创建混淆用户名的扩展。 它可以阻止使用混合脚本创建令人困惑和类似用户名的帐户。

例如,如果用户John Doe已经注册,则扩展将阻止尝试注册:

  • joHn dOE (capital letters in different places)
  • Jοhn Doe ("ο"和Jοhn希腊语的小写字母。)
  • John Dоe ("о"和Dоe西里尔字母中小写的O。)
  • Јohn Doe ("Ј" in Јohn is Cyrillic capital letter Je)
  • John Đoe ("Đ" in Đoe is Latin capital letter D with stroke)
  • Jóhn Doe ("ó" in Jóhn is Latin small letter O with acute)
  • John ​Doe (there is a Zero-width space before Doe)
  • Jøhn Doe ("ø" in Jøhn is Scandinavian oe)
  • J0hn Doe ("0"是阿拉伯数字0)



  • 下载文件,并将其放置在您extensions/文件夹中的AntiSpoof目录内。
  • 将下列代码放置在您的LocalSettings.php的底部:
    wfLoadExtension( 'AntiSpoof' );
  • 运行更新脚本,它将自动创建此扩展必须依赖的数据库表。
  • 如果用户账户存储在一个共享的数据库中,则添加:
$wgSharedTables[] = 'spoofuser';
  • Run the batchAntiSpoof.php script from the command line to pre-populate the spoofuser table with your wiki's existing usernames.
php extensions/AntiSpoof/maintenance/batchAntiSpoof.php
  •   完成 – 在您的wiki上导航至Special:Version,以验证扩展已成功安装。

致使用MediaWiki 1.24或更早版本的用户:

上面的说明介绍的是安装此扩展的新方法,它使用wfLoadExtension()。 如果您需要在早期版本(MediaWiki 1.24和更早版本)中安装此扩展,而不是wfLoadExtension( 'AntiSpoof' );,您需要使用:

require_once "$IP/extensions/AntiSpoof/AntiSpoof.php";
  • To verify that it's working, try creating an account for username "Adm1n"; most wikis have an "Admin" account and so AntiSpoof should reject this lookalike username with a message like "The name Adm1n is too similar to the existing account: Admin".
When installing from Git, please note that this extension requires Composer.

So, after installation from Git change to the directory containing the extension e.g. "../extensions/AntiSpoof/" and run composer install --no-dev, or when updating: composer update --no-dev.

Alternatively as well as preferably add the line "extensions/AntiSpoof/composer.json" to the "composer.local.json" file in the root directory of your wiki like e.g.

	"extra": {
		"merge-plugin": {
			"include": [