24 protected $blacklist = [
'\b01bags\.com\b',
'sytes\.net' ];
40 [
'https://example.com' ],
43 'revision with spam, with additional non-spam' => [
44 [
'https://foo.com',
'http://01bags.com',
'http://bar.com' ],
48 'revision with spam using full width stop normalization' => [
49 [
'http://01bags.com' ],
53 'revision with domain blacklisted as spam, but subdomain whitelisted' => [
54 [
'http://a5b.sytes.net' ],
63 public function testSpam( $links, $expected ) {
64 $returnValue = $this->spamFilter->filter( $links, Title::newMainPage() );
78 \MessageCache::singleton()->enable();
79 $this->
insertPage(
'MediaWiki:Spam-blacklist', implode(
"\n", $this->blacklist ) );
80 $this->
insertPage(
'MediaWiki:Spam-whitelist', implode(
"\n", $this->whitelist ) );
85 $reflProp->setAccessible(
true );
86 $reflProp->setValue( $instance,
false );
90 \MessageCache::singleton()->disable();
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
static getInstance( $type)
Returns an instance of the given blacklist.
SpamBlacklist Database SpamBlacklist.
testSpam( $links, $expected)
spamProvider
array $whitelist
Spam whitelist regexes.
array $blacklist
Spam blacklist regexes.
SpamBlacklist $spamFilter
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))