Extension:SpamRegex

From MediaWiki.org

Jump to: navigation, search
Manual on MediaWiki Extensions
List of MediaWiki Extensions
SpamRegex

Release status: stable

Implementation Special page
Description Adds a special page to filter out unwanted expressions.
Author(s) Bartek Łapiński
Last Version 1.0 (26th of July, 2008)
MediaWiki 1.11+
License No license specified
Download SimplifiedRegex (needed)
SpamRegex
Added rights spamregex
Hooks used EditFilter

SpecialMovepageBeforeMove

SpamRegex extension adds a special page, Special:SpamRegex, to filter out unwanted expressions. The spamregexed expressions cannot be used in page content, edit summaries or move summaries, depending on what was chosen by the user who blocked an expression. A full list of currently blocked expressions can be viewed at the same special page.

[edit] Installation

  1. Create the spam_regex table with the SQL query below.
  2. Copy the /SpamRegex folder and its contents into $IP/extensions.
  3. If not already supplied with RegexBlock extension, copy SimplifiedRegex.php into $IP/extensions/SimplifiedRegex/.
  4. Include the SpamRegex.php in GlobalSettings.php.
  5. This extension uses Memcached - please check if Memcached is configured properly in Global/LocalSettings.php.

That should do the trick. If people belonging to staff cannot access the extension, check if relogin helps. If not, please check if the staff permissions are not overwritten after the initialization of the extension. If that is the case, the permissions should be rather appended (the extension adds one new permission right).


[edit] SQL query to create the table

CREATE TABLE `spam_regex` (
                `spam_id` int(5) NOT NULL AUTO_INCREMENT,
                `spam_text` varchar(255) NOT NULL,
                `spam_timestamp` char(14) NOT NULL,
                `spam_user` varchar(255) NOT NULL,
                `spam_textbox` int(1) NOT NULL DEFAULT 1,
                `spam_summary` int(1) NOT NULL DEFAULT 0,
                PRIMARY KEY  (`spam_id`),
                UNIQUE KEY `spam_text` (`spam_text`),
                KEY `spam_timestamp` (`spam_timestamp`),
                KEY `spam_user` (`spam_user`)
);

[edit] Usage

  1. Go to Special:SpamRegex
  2. Enter the phrase to be blocked into the "Phrase to block" box
  3. Select one or both of the available options: block phrase in page text & block phrase in summary (edit summaries)
  4. Press the "Block this phrase" button
Personal tools