From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual
Crystal Clear action run.png

Release status: stable

Implementation User activity
Description Prevents the creation of confusable usernames.
Author(s) Brion Vibber (Brion VIBBERtalk)
MediaWiki 1.13+
Database changes Yes
Tables spoofuser
License GPL v2 or later


Added rights


Hooks used


Translate the AntiSpoof extension if it is available at translatewiki.net

Check usage and version matrix; code metrics
Bugs: list open list all report

The AntiSpoof extension is an extension for preventing confusable usernames from being created. It blocks the creation of accounts with mixed-script, confusing and similar usernames.

For example, if user John Doe is already registered, the extension will block attempts to register:

  • Jοhn Doe ("ο" in Jοhn is Greek small letter omicron),
  • John Dоe ("о" in Dоe is Cyrillic small letter 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),


Download[edit | edit source]

You can download the extension directly from the MediaWiki source code repository (browse code). You can get:

One of the extension's tags

Not all extensions have tags. Some extensions have tags for each release, in which case those tags have the same stability as the release. To download a tag

  • Go to the tags list
  • Click the name of the tag you want to download
  • Click "snapshot"
The latest version of one of the extension's branches

Each extension has a master branch containing the latest code (might be unstable). Extensions may have further branches as well.

  • Go to the branches list
  • Click the branch name
  • Click "snapshot"
A snapshot made during the release of a MediaWiki version.

This might be unstable and is not guaranteed to work with the associated MediaWiki version.

After you've got the code, save it into the extensions/AntiSpoof directory of your wiki.

If you are familiar with git and have shell access to your server, you can obtain the extension, with all its tags and branches, as follows:

cd extensions
git clone https://gerrit.wikimedia.org/r/p/mediawiki/extensions/AntiSpoof.git

Installation[edit | edit source]

  1. Create a directory AntiSpoof in your $IP/extensions directory.
  2. Extract the files to this $IP/extensions/AntiSpoof directory.
  3. Add
    require_once( "$IP/extensions/AntiSpoof/AntiSpoof.php" );
    to the bottom of LocalSettings.php.
  4. In case user accounts are stored in a shared database, add
    $wgSharedTables[] = 'spoofuser';
    just after that line.
  5. Add the required tables to the database; on the command line, enter:
    php maintenance/update.php
    (Note: Your designated database user needs to have CREATE rights on your MediaWiki database.)
  6. Run the batchAntiSpoof.php script from the command line to pre-populate the antispoof table with your wiki's existing usernames. Enter:
    php extensions/AntiSpoof/maintenance/batchAntiSpoof.php
  7. The Special:Version of your wiki should show the extension is installed. 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'.

See also[edit | edit source]

Language: English  • 日本語 • русский