2004-12-11 09:59:06 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
# Loader for spam blacklist feature
|
|
|
|
# Include this from LocalSettings.php
|
|
|
|
|
|
|
|
if ( defined( 'MEDIAWIKI' ) ) {
|
|
|
|
|
|
|
|
global $wgFilterCallback, $wgPreSpamFilterCallback;
|
|
|
|
global $wgSpamBlacklistFiles;
|
2005-07-08 16:29:22 +00:00
|
|
|
global $wgSpamBlacklistSettings;
|
2004-12-11 09:59:06 +00:00
|
|
|
|
|
|
|
$wgSpamBlacklistFiles = false;
|
2005-07-08 16:29:22 +00:00
|
|
|
$wgSpamBlacklistSettings = array();
|
2004-12-11 09:59:06 +00:00
|
|
|
|
|
|
|
if ( $wgFilterCallback ) {
|
|
|
|
$wgPreSpamFilterCallback = $wgFilterCallback;
|
|
|
|
} else {
|
|
|
|
$wgPreSpamFilterCallback = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
$wgFilterCallback = 'wfSpamBlacklistLoader';
|
2005-08-26 14:33:40 +00:00
|
|
|
$wgExtensionCredits['other'][] = array(
|
|
|
|
'name' => 'SpamBlacklist',
|
2006-06-23 22:22:09 +00:00
|
|
|
'author' => 'Tim Starling',
|
2007-06-26 10:38:04 +00:00
|
|
|
'url' => 'http://www.mediawiki.org/wiki/Extension:SpamBlacklist',
|
2007-01-07 13:57:35 +00:00
|
|
|
'description' => 'Regex based anti spam tool',
|
2005-08-26 14:33:40 +00:00
|
|
|
);
|
2004-12-11 09:59:06 +00:00
|
|
|
|
|
|
|
function wfSpamBlacklistLoader( &$title, $text, $section ) {
|
|
|
|
require_once( "SpamBlacklist_body.php" );
|
|
|
|
static $spamObj = false;
|
2005-07-08 16:29:22 +00:00
|
|
|
global $wgSpamBlacklistFiles, $wgSpamBlacklistSettings, $wgPreSpamFilterCallback;
|
2004-12-11 09:59:06 +00:00
|
|
|
|
|
|
|
if ( $spamObj === false ) {
|
2005-07-08 16:29:22 +00:00
|
|
|
$spamObj = new SpamBlacklist( $wgSpamBlacklistSettings );
|
2004-12-11 09:59:06 +00:00
|
|
|
if ( $wgSpamBlacklistFiles ) {
|
|
|
|
$spamObj->files = $wgSpamBlacklistFiles;
|
|
|
|
$spamObj->previousFilter = $wgPreSpamFilterCallback;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return $spamObj->filter( $title, $text, $section );
|
|
|
|
}
|
|
|
|
|
|
|
|
} # End invocation guard
|
2007-06-29 01:36:09 +00:00
|
|
|
|