MediaWiki
1.34.4
|
Public Member Functions | |
filter (array $links, Title $title=null, $preventLog=false, $mode='check') | |
getCurrentLinks (Title $title) | |
Look up the links currently in the article, so we can ignore them on a second run. More... | |
getRegexEnd ( $batchSize) | |
Returns the end of the regex for matches. More... | |
getRegexStart () | |
Returns the start of the regex for matches. More... | |
logFilterHit ( $title, $url) | |
Logs the filter hit to Special:Log if $wgLogSpamBlacklistHits is enabled. More... | |
warmCachesForFilter (Title $title, array $entries) | |
Public Member Functions inherited from BaseBlacklist | |
__construct ( $settings=[]) | |
Constructor. More... | |
clearCache () | |
Clear all primary blacklist cache keys. More... | |
filter (array $links, Title $title, $preventLog=false) | |
getBlacklists () | |
Fetch local and (possibly cached) remote blacklists. More... | |
getLocalBlacklists () | |
Returns the local blacklist. More... | |
getWhitelists () | |
Returns the (local) whitelist. More... | |
Public Attributes | |
const | STASH_AGE_DYING = 150 |
const | STASH_TTL = 180 |
Public Attributes inherited from BaseBlacklist | |
int | $expiryTime = 900 |
array | $files = [] |
Array of blacklist sources. More... | |
int | $warningChance = 100 |
Chance of receiving a warning when the filter is hit. More... | |
int | $warningTime = 600 |
Protected Member Functions | |
antiSpoof ( $text) | |
Apply some basic anti-spoofing to the links before they get filtered, see. More... | |
getBlacklistType () | |
Returns the code for the blacklist implementation. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from BaseBlacklist | |
static | addBlacklistType ( $type, $class) |
Adds a blacklist class to the registry. More... | |
static | getBlacklistTypes () |
Return the array of blacklist types currently defined. More... | |
static | getEmailBlacklist () |
static | getInstance ( $type) |
Returns an instance of the given blacklist. More... | |
static | getSpamBlacklist () |
static | getTypeFromTitle (Title $title) |
Returns the type of blacklist from the given title. More... | |
static | isLocalSource (Title $title) |
Check if the given local page title is a spam regex source. More... | |
Protected Attributes inherited from BaseBlacklist | |
bool array | $regexes = false |
Array containing regexes to test against. More... | |
Definition at line 6 of file SpamBlacklist.php.
|
protected |
Apply some basic anti-spoofing to the links before they get filtered, see.
string | $text |
Definition at line 27 of file SpamBlacklist.php.
SpamBlacklist::filter | ( | array | $links, |
Title | $title = null , |
||
$preventLog = false , |
|||
$mode = 'check' |
|||
) |
string[] | $links | An array of links to check against the blacklist |
Title | null | $title | The title of the page to which the filter shall be applied. This is used to load the old links already on the page, so the filter is only applied to links that got added. If not given, the filter is applied to all $links. |
bool | $preventLog | Whether to prevent logging of hits. Set to true when the action is testing the links rather than attempting to save them (e.g. the API spamblacklist action) |
string | $mode | Either 'check' or 'stash' |
Definition at line 45 of file SpamBlacklist.php.
References $cache, $matches, $title, $wgRequest, BaseBlacklist\getBlacklists(), getBlacklistType(), getCurrentLinks(), ObjectCache\getLocalClusterInstance(), BaseBlacklist\getWhitelists(), logFilterHit(), and wfDebugLog().
Referenced by warmCachesForFilter().
|
protected |
Returns the code for the blacklist implementation.
Reimplemented from BaseBlacklist.
Definition at line 15 of file SpamBlacklist.php.
Referenced by filter().
SpamBlacklist::getCurrentLinks | ( | Title | $title | ) |
Look up the links currently in the article, so we can ignore them on a second run.
WARNING: I can add more of the same link with no problem here.
Title | $title |
Definition at line 167 of file SpamBlacklist.php.
References $cache, $dbr, $title, DB_REPLICA, and wfGetDB().
Referenced by filter().
SpamBlacklist::getRegexEnd | ( | $batchSize | ) |
Returns the end of the regex for matches.
int | $batchSize |
Reimplemented from BaseBlacklist.
Definition at line 207 of file SpamBlacklist.php.
SpamBlacklist::getRegexStart | ( | ) |
Returns the start of the regex for matches.
Reimplemented from BaseBlacklist.
Definition at line 197 of file SpamBlacklist.php.
SpamBlacklist::logFilterHit | ( | $title, | |
$url | |||
) |
Logs the filter hit to Special:Log if $wgLogSpamBlacklistHits is enabled.
Title | $title | |
string | $url | URL that the user attempted to add |
Definition at line 218 of file SpamBlacklist.php.
References $title, and ExtensionRegistry\getInstance().
Referenced by filter().
SpamBlacklist::warmCachesForFilter | ( | Title | $title, |
array | $entries | ||
) |
Title | $title | |
string[] | $entries |
Reimplemented from BaseBlacklist.
Definition at line 188 of file SpamBlacklist.php.
const SpamBlacklist::STASH_AGE_DYING = 150 |
Definition at line 8 of file SpamBlacklist.php.
const SpamBlacklist::STASH_TTL = 180 |
Definition at line 7 of file SpamBlacklist.php.