LinkFilter Class Reference

Some functions to help implement an external link filter for spam control. More...

List of all members.

Static Public Member Functions

static matchEntry ($text, $filterEntry)
static makeLike ($filterEntry, $prot= 'http://')
 Make a string to go after an SQL LIKE, which will match the specified string.

Static Private Member Functions

static makeRegex ($filterEntry)


Detailed Description

Some functions to help implement an external link filter for spam control.

TODO: implement the filter. Currently these are just some functions to help maintenance/cleanupSpam.php remove links to a single specified domain. The next thing is to implement functions for checking a given page against a big list of domains.

Another cool thing to do would be a web interface for fast spam removal.

Definition at line 13 of file LinkFilter.php.


Member Function Documentation

static LinkFilter::makeLike ( filterEntry,
prot = 'http://' 
) [static]

Make a string to go after an SQL LIKE, which will match the specified string.

There are several kinds of filter entry: *.domain.com - Produces http://com.domain.%, matches domain.com and www.domain.com domain.com - Produces http://com.domain./%, matches domain.com or domain.com/ but not www.domain.com *.domain.com/x - Produces http://com.domain.%/x%, matches www.domain.com/xy domain.com/x - Produces http://com.domain./x%, matches domain.com/xy but not www.domain.com/xy

Asterisks in any other location are considered invalid.

Parameters:
$filterEntry String: domainparts
$prot String: protocol

Definition at line 53 of file LinkFilter.php.

References $db, $like, $path, and wfGetDB().

Referenced by LinkSearchPage::mungeQuery(), and ApiQueryExtLinksUsage::run().

static LinkFilter::makeRegex ( filterEntry  )  [static, private]

Definition at line 25 of file LinkFilter.php.

Referenced by matchEntry().

static LinkFilter::matchEntry ( text,
filterEntry 
) [static]

Definition at line 17 of file LinkFilter.php.

References $text, and makeRegex().

Referenced by cleanupArticle().


The documentation for this class was generated from the following file:

Generated on Sat Sep 5 02:08:41 2009 for MediaWiki by  doxygen 1.5.9