diff options
Diffstat (limited to 'extensions/SpamBlacklist/SpamBlacklist.php')
-rw-r--r-- | extensions/SpamBlacklist/SpamBlacklist.php | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/extensions/SpamBlacklist/SpamBlacklist.php b/extensions/SpamBlacklist/SpamBlacklist.php index f3e27f3c..2fd7855d 100644 --- a/extensions/SpamBlacklist/SpamBlacklist.php +++ b/extensions/SpamBlacklist/SpamBlacklist.php @@ -10,7 +10,7 @@ if ( !defined( 'MEDIAWIKI' ) ) { $wgExtensionCredits['antispam'][] = array( 'path' => __FILE__, 'name' => 'SpamBlacklist', - 'author' => array( 'Tim Starling', 'John Du Hart' ), + 'author' => array( 'Tim Starling', 'John Du Hart', 'Daniel Kinzler' ), 'url' => 'https://www.mediawiki.org/wiki/Extension:SpamBlacklist', 'descriptionmsg' => 'spam-blacklist-desc', ); @@ -21,7 +21,16 @@ $wgExtensionMessagesFiles['SpamBlackList'] = $dir . 'SpamBlacklist.i18n.php'; /** * Array of settings for blacklist classes */ -$wgBlacklistSettings = array(); +$wgBlacklistSettings = array( + 'spam' => array( + 'files' => array( "http://meta.wikimedia.org/w/index.php?title=Spam_blacklist&action=raw&sb_ver=1" ) + ) +); + +/** + * Log blacklist hits to Special:Log + */ +$wgLogSpamBlacklistHits = false; /** * @deprecated @@ -33,10 +42,19 @@ $wgSpamBlacklistFiles =& $wgBlacklistSettings['spam']['files']; */ $wgSpamBlacklistSettings =& $wgBlacklistSettings['spam']; -$wgHooks['EditFilterMerged'][] = 'SpamBlacklistHooks::filterMerged'; +if ( !defined( 'MW_SUPPORTS_CONTENTHANDLER' ) ) { + die( "This version of SpamBlacklist requires a version of MediaWiki that supports the ContentHandler facility (supported since MW 1.21)." ); +} + +// filter pages on save +$wgHooks['EditFilterMergedContent'][] = 'SpamBlacklistHooks::filterMergedContent'; $wgHooks['APIEditBeforeSave'][] = 'SpamBlacklistHooks::filterAPIEditBeforeSave'; + +// editing filter rules $wgHooks['EditFilter'][] = 'SpamBlacklistHooks::validate'; -$wgHooks['ArticleSaveComplete'][] = 'SpamBlacklistHooks::articleSave'; +$wgHooks['PageContentSaveComplete'][] = 'SpamBlacklistHooks::pageSaveContent'; + +// email filters $wgHooks['UserCanSendEmail'][] = 'SpamBlacklistHooks::userCanSendEmail'; $wgHooks['AbortNewAccount'][] = 'SpamBlacklistHooks::abortNewAccount'; @@ -45,3 +63,10 @@ $wgAutoloadClasses['EmailBlacklist'] = $dir . 'EmailBlacklist.php'; $wgAutoloadClasses['SpamBlacklistHooks'] = $dir . 'SpamBlacklistHooks.php'; $wgAutoloadClasses['SpamBlacklist'] = $dir . 'SpamBlacklist_body.php'; $wgAutoloadClasses['SpamRegexBatch'] = $dir . 'SpamRegexBatch.php'; + +$wgLogTypes[] = 'spamblacklist'; +$wgLogActionsHandlers['spamblacklist/*'] = 'LogFormatter'; +$wgLogRestrictions['spamblacklist'] = 'spamblacklistlog'; +$wgGroupPermissions['sysop']['spamblacklistlog'] = true; + +$wgAvailableRights[] = 'spamblacklistlog'; |