Index: trunk/extensions/SpamBlacklist/SpamBlacklist_body.php |
— | — | @@ -10,10 +10,15 @@ |
11 | 11 | var $expiryTime = 900; |
12 | 12 | var $warningChance = 100; |
13 | 13 | |
14 | | - function SpamBlacklist() { |
| 14 | + function SpamBlacklist( $settings = array() ) { |
15 | 15 | 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 | + } |
17 | 21 | } |
| 22 | + |
18 | 23 | function filter( &$title, $text, $section ) { |
19 | 24 | global $wgArticle, $wgDBname, $wgMemc, $messageMemc, $wgVersion, $wgOut; |
20 | 25 | |
Index: trunk/extensions/SpamBlacklist/SpamBlacklist.php |
— | — | @@ -7,8 +7,10 @@ |
8 | 8 | |
9 | 9 | global $wgFilterCallback, $wgPreSpamFilterCallback; |
10 | 10 | global $wgSpamBlacklistFiles; |
| 11 | +global $wgSpamBlacklistSettings; |
11 | 12 | |
12 | 13 | $wgSpamBlacklistFiles = false; |
| 14 | +$wgSpamBlacklistSettings = array(); |
13 | 15 | |
14 | 16 | if ( $wgFilterCallback ) { |
15 | 17 | $wgPreSpamFilterCallback = $wgFilterCallback; |
— | — | @@ -21,10 +23,10 @@ |
22 | 24 | function wfSpamBlacklistLoader( &$title, $text, $section ) { |
23 | 25 | require_once( "SpamBlacklist_body.php" ); |
24 | 26 | static $spamObj = false; |
25 | | - global $wgSpamBlacklistFiles, $wgPreSpamFilterCallback; |
| 27 | + global $wgSpamBlacklistFiles, $wgSpamBlacklistSettings, $wgPreSpamFilterCallback; |
26 | 28 | |
27 | 29 | if ( $spamObj === false ) { |
28 | | - $spamObj = new SpamBlacklist; |
| 30 | + $spamObj = new SpamBlacklist( $wgSpamBlacklistSettings ); |
29 | 31 | if ( $wgSpamBlacklistFiles ) { |
30 | 32 | $spamObj->files = $wgSpamBlacklistFiles; |
31 | 33 | $spamObj->previousFilter = $wgPreSpamFilterCallback; |