Extension:TitleBlacklist

From MediaWiki.org

(Redirected from Extension:Title Blacklist)
Jump to: navigation, search

             

Manual on MediaWiki Extensions
List of MediaWiki Extensions
Crystal Clear action run.png
Title Blacklist

Release status: stable

Implementation  User rights
Description Block the creation of pages matching a regular expression blacklist
Author(s)  VasilievVV
Last Version  v1.4.2 (05/08/2008)
MediaWiki  1.12.0+
License No license specified
Download from Subversion

check usage (experimental)

The Title Blacklist extension allows wiki administrators to block the creation, movement and upload of pages which title matches one or more regular expressions, as well as blocking creation of accounts with matching usernames.

Contents

[edit] Requirements

Extension requires MediaWiki 1.12.0 or above (it needs AbortMove hook).

[edit] Installation

  1. Check out all extension files from Subversion and place them in a TitleBlacklist subdirectory within your MediaWiki extensions directory
  2. Add the line require_once( "{$IP}/extensions/TitleBlacklist/TitleBlacklist.php" ); to your LocalSettings.php file
  3. Configure blacklist sources (see below)

Installation can be verified through the Special:Version page on the wiki.

[edit] Multiple blacklist sources

Title blacklist can be gathered from multiple sources except local message. For configuring blacklist sources use code like this:

$wgTitleBlacklistSources = array(
    array(
         'type' => TBLSRC_LOCALPAGE,
         'src'  => 'Project:Title blacklist',
    ),
    array(
         'type' => TBLSRC_URL,
         'src'  => 'http://meta.wikimedia.org/w/index.php?title=Title_blacklist&action=raw',
    ),
    array(
         'type' => TBLSRC_FILE,
         'src'  => '/home/wikipedia/blacklists/titles',
    ),
);
  • Use TBLSRC_LOCALPAGE for using local page as title blacklist
  • Use TBLSRC_URL for using external URL as title blacklist
  • Use TBLSRC_FILE for using file as title blacklist

[edit] Editing the blacklist

The title blacklist is maintained as a system message MediaWiki:Titleblacklist.

This page consists of regular expressions, each on a separate line, for example:

Foo <autoconfirmed|noedit|errmsg=blacklisted-testpage> 
[Bb]ar #No one should create article about it

Each entry may also contain optional attributes, enclosed in <> and separated with |

  • autoconfirmed - only autoconfirmed users are able to create/upload/move such pages
  • casesensitive - don't ignore case when checking title for being blacklisted
  • noedit - users are also unable to edit this article
  • moveonly - forbid moves but allow ordinary creation (rev:35163)
  • newaccountonly - forbid creation of matching usernames, but allow page creation (rev:38977)
  • reupload - allow reuploads of existing blacklisted files (rev:33656)
  • errmsg - the name of the message that should be displayed instead of standard

Note that what is referred to here as regular expressions are not proper regular expressions, but rather subpatterns that are inserted into a hard-coded regular expression. i.e. the subpattern Foo from above would create a regular expression like /^Foo$/usi.

[edit] Customising warning messages

When an attempt to create a page is blocked due to a blacklisted title, a warning message is shown to the user. This can be customised via system messages

Custom messages can be defined by using the errmsg attribute.

[edit] Whitelist

There is also a whitelist at MediaWiki:Titlewhitelist.

[edit] Change log

A complete log of changes to the extension code (including internationalisation updates from third parties) is available from the Subversion log, however, summarised information on changes between point releases is given below:

Version Revision Release Date Comments
1.4.2 38636 05/08/2008
1.4.1 31074 18/02/2008
1.4 28866 26/12/2007
1.3 28657 19/12/2007 Check for blacklist validity before saving
1.2 28504 15/12/2007 Cleaned up version with caching support
1.1 28362 10/12/2007 New version with support of entry attributes and multiple sources
1.0 27208 05/11/2007 Initial version

[edit] Resources on regular expressions

This extension is being used on one or more of Wikimedia's wikis. It means that the extension is stable and works well enough to be used by such high traffic websites. A full list of the extensions installed on a particular wiki is produced by Special:Version on that wiki.