MediaWiki REL1_30
|
Public Member Functions | |
doLogging (User $user, Title $title, $revId) | |
Actually push the url change events post-save. | |
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. | |
getRegexEnd ( $batchSize) | |
Returns the end of the regex for matches. | |
getRegexStart () | |
Returns the start of the regex for matches. | |
isLoggingEnabled () | |
logFilterHit ( $title, $url) | |
Logs the filter hit to Special:Log if $wgLogSpamBlacklistHits is enabled. | |
logUrlChanges ( $oldLinks, $newLinks, $addedLinks) | |
Diff added/removed urls and generate events for them. | |
warmCachesForFilter (Title $title, array $entries) | |
Public Member Functions inherited from BaseBlacklist | |
__construct ( $settings=[]) | |
Constructor. | |
buildSharedBlacklists () | |
clearCache () | |
Clear all primary blacklist cache keys. | |
filter (array $links, Title $title, $preventLog=false) | |
getArticleText ( $wiki, $article) | |
Fetch an article from this or another local MediaWiki database. | |
getBlacklists () | |
Fetch local and (possibly cached) remote blacklists. | |
getHttpText ( $fileName) | |
getLocalBlacklists () | |
Returns the local blacklist. | |
getSharedBlacklists () | |
Fetch (possibly cached) remote blacklists. | |
getWhitelists () | |
Returns the (local) whitelist. | |
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. | |
int | $warningChance = 100 |
Chance of receiving a warning when the filter is hit. | |
int | $warningTime = 600 |
Protected Member Functions | |
antiSpoof ( $text) | |
Apply some basic anti-spoofing to the links before they get filtered, see. | |
getBlacklistType () | |
Returns the code for the blacklist implementation. | |
Private Member Functions | |
logUrlChange ( $url, $action) | |
Queue log data about change for a url addition or removal. | |
Private Attributes | |
array[] | $urlChangeLog = [] |
Changes to external links, for logging purposes. | |
Additional Inherited Members | |
Static Public Member Functions inherited from BaseBlacklist | |
static | addBlacklistType ( $type, $class) |
Adds a blacklist class to the registry. | |
static | getBlacklistTypes () |
Return the array of blacklist types currently defined. | |
static | getInstance ( $type) |
Returns an instance of the given blacklist. | |
static | getTypeFromTitle (Title $title) |
Returns the type of blacklist from the given title. | |
static | isLocalSource (Title $title) |
Check if the given local page title is a spam regex source. | |
Protected Attributes inherited from BaseBlacklist | |
bool array | $regexes = false |
Array containing regexes to test against. | |
Definition at line 9 of file SpamBlacklist_body.php.
|
protected |
Apply some basic anti-spoofing to the links before they get filtered, see.
string | $text |
Definition at line 36 of file SpamBlacklist_body.php.
Actually push the url change events post-save.
Definition at line 212 of file SpamBlacklist_body.php.
References $urlChangeLog, and isLoggingEnabled().
string[] | $links | An array of links to check against the blacklist |
Title | $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 54 of file SpamBlacklist_body.php.
References $cache, $matches, $wgRequest, BaseBlacklist\getBlacklists(), getBlacklistType(), getCurrentLinks(), BaseBlacklist\getWhitelists(), isLoggingEnabled(), logFilterHit(), logUrlChanges(), wfDebugLog(), wfRestoreWarnings(), and wfSuppressWarnings().
Referenced by warmCachesForFilter().
|
protected |
Returns the code for the blacklist implementation.
Reimplemented from BaseBlacklist.
Definition at line 24 of file SpamBlacklist_body.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 271 of file SpamBlacklist_body.php.
References $cache, $dbr, DB_SLAVE, function, and wfGetDB().
Referenced by filter().
SpamBlacklist::getRegexEnd | ( | $batchSize | ) |
Returns the end of the regex for matches.
$batchSize |
Reimplemented from BaseBlacklist.
Definition at line 310 of file SpamBlacklist_body.php.
SpamBlacklist::getRegexStart | ( | ) |
Returns the start of the regex for matches.
Reimplemented from BaseBlacklist.
Definition at line 300 of file SpamBlacklist_body.php.
SpamBlacklist::isLoggingEnabled | ( | ) |
Definition at line 178 of file SpamBlacklist_body.php.
Referenced by doLogging(), filter(), and logUrlChanges().
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 320 of file SpamBlacklist_body.php.
References $wgUser, and ExtensionRegistry\getInstance().
Referenced by filter().
|
private |
Queue log data about change for a url addition or removal.
string | $url | |
string | $action | 'insert' or 'remove' |
Definition at line 245 of file SpamBlacklist_body.php.
References wfDebugLog(), and wfParseUrl().
Referenced by logUrlChanges().
SpamBlacklist::logUrlChanges | ( | $oldLinks, | |
$newLinks, | |||
$addedLinks ) |
Diff added/removed urls and generate events for them.
string[] | $oldLinks | |
string[] | $newLinks | |
string[] | $addedLinks |
Definition at line 190 of file SpamBlacklist_body.php.
References isLoggingEnabled(), and logUrlChange().
Referenced by filter().
SpamBlacklist::warmCachesForFilter | ( | Title | $title, |
array | $entries ) |
Title | $title | |
string[] | $entries |
Reimplemented from BaseBlacklist.
Definition at line 291 of file SpamBlacklist_body.php.
References filter().
|
private |
Changes to external links, for logging purposes.
Definition at line 17 of file SpamBlacklist_body.php.
Referenced by doLogging().
const SpamBlacklist::STASH_AGE_DYING = 150 |
Definition at line 11 of file SpamBlacklist_body.php.
const SpamBlacklist::STASH_TTL = 180 |
Definition at line 10 of file SpamBlacklist_body.php.