Extension:Phalanx

Phalanx extension is an integrated special control mechanism. The integrated means that it integrates several (mostly Wikia) extensions into one, ultimate anti-spam tool: BadWords, FilterWords, regexBlock, SpamBlacklist, spamRegex, TextRegex and TitleBlacklist.

Phalanx was originally developed by and for Wikia; this page documents the fork of Phalanx that ShoutWiki uses, which was originally forked in June 2010 and is currently based on r25850 of Wikia's SVN.

Installation

 * 1) Dump the files into
 * 2) Add  into the wiki's LocalSettings.php
 * 3) Installation can now be verified through the wiki's Special:Version

User rights
Phalanx extension adds two new user rights, phalanx and phalanxexempt. The phalanx user right is required to access Special:Phalanx and Special:PhalanxStats; to add, modify and remove filters and to view statistics.

Users with phalanxexempt user right are exempt from Phalanx filters.

Testing filters
Users with the phalanx user right can test currently active filters by choosing the "Test Filters" tab on Special:Phalanx, entering text (such as a spam phrase, a username or something else that is or should be blocked in Phalanx) and pressing the button. If there is a match, you'll be informed what filter the text triggers; if there isn't a match (and you know there should be), try changing the options of a block. One of the most common problems is using the "exact" option with text, such as content or summary blocks; you should almost always use the regex option, because the "exact" option is too dumb and it can easily be fooled.

Technical notes

 * Number of i18n messages: 89 (as of 18 July 2012)
 * GUI for Special:Phalanx is in extensions/Phalanx/templates/phalanx.tmpl.php
 * CSS changs:
 * wikia-tabs has been renamed to phalanx-tabs
 * accent &rarr; phalanx-accent
 * clearfix styles copied from Monaco's root.css; required for proper GUI display
 * Requires jQuery 1.4.2 or higher
 * Actual blocking classes are in blocks/ (for example, ContentBlock.class.php) and are loaded in Phalanx.php for users who do not have the phalanxexempt right
 * Used hooks:
 * Core hooks:
 * AbortMove
 * EditFilter
 * GetBlockedStatus
 * Wikia hooks:
 * AutoCreateWiki::checkBadWords
 * ApiCreateMultiplePagesBeforeCreation
 * CreateDefaultQuestionPageFilter
 * CreatePageTitleCheck
 * DefaultQuestion::filterWordsTest
 * ProblemReportsContentCheck
 * SpecialMovepageBeforeMove
 * the functionality hooked into this hook has been moved to ContentBlock