r10017 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r10016‎ | r10017 | r10018 >
Date:16:29, 8 July 2005
Author:timstarling
Status:old
Tags:
Comment:
More configuration settings, fixed URL
Modified paths:
  • /trunk/extensions/SpamBlacklist/SpamBlacklist.php (modified) (history)
  • /trunk/extensions/SpamBlacklist/SpamBlacklist_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SpamBlacklist/SpamBlacklist_body.php
@@ -10,10 +10,15 @@
1111 var $expiryTime = 900;
1212 var $warningChance = 100;
1313
14 - function SpamBlacklist() {
 14+ function SpamBlacklist( $settings = array() ) {
1515 global $IP;
16 - $this->files = array( "http://meta.wikimedia.org/wiki/Spam_blacklist?action=raw&sb_ver=1" );
 16+ $this->files = array( "http://meta.wikimedia.org/w/index.php?title=Spam_blacklist&action=raw&sb_ver=1" );
 17+
 18+ foreach ( $settings as $name => $value ) {
 19+ $this->$name = $value;
 20+ }
1721 }
 22+
1823 function filter( &$title, $text, $section ) {
1924 global $wgArticle, $wgDBname, $wgMemc, $messageMemc, $wgVersion, $wgOut;
2025
Index: trunk/extensions/SpamBlacklist/SpamBlacklist.php
@@ -7,8 +7,10 @@
88
99 global $wgFilterCallback, $wgPreSpamFilterCallback;
1010 global $wgSpamBlacklistFiles;
 11+global $wgSpamBlacklistSettings;
1112
1213 $wgSpamBlacklistFiles = false;
 14+$wgSpamBlacklistSettings = array();
1315
1416 if ( $wgFilterCallback ) {
1517 $wgPreSpamFilterCallback = $wgFilterCallback;
@@ -21,10 +23,10 @@
2224 function wfSpamBlacklistLoader( &$title, $text, $section ) {
2325 require_once( "SpamBlacklist_body.php" );
2426 static $spamObj = false;
25 - global $wgSpamBlacklistFiles, $wgPreSpamFilterCallback;
 27+ global $wgSpamBlacklistFiles, $wgSpamBlacklistSettings, $wgPreSpamFilterCallback;
2628
2729 if ( $spamObj === false ) {
28 - $spamObj = new SpamBlacklist;
 30+ $spamObj = new SpamBlacklist( $wgSpamBlacklistSettings );
2931 if ( $wgSpamBlacklistFiles ) {
3032 $spamObj->files = $wgSpamBlacklistFiles;
3133 $spamObj->previousFilter = $wgPreSpamFilterCallback;

Status & tagging log