Go to the documentation of this file.
31 $pout = $editInfo->output;
32 $links = array_keys( $pout->getExternalLinks() );
36 if ( preg_match(
'/\S(\.[^\s\d]{2,}|[\/@]\S)/', $summary ) ) {
48 'spamblacklist' => [
'matches' =>
$matches ],
63 $links = array_keys(
$output->getExternalLinks() );
65 $spamObj->warmCachesForFilter( $page->
getTitle(), $links );
77 if ( $blacklist->checkUser( $user ) ) {
81 $hookErr = [
'spam-blacklisted-email',
'spam-blacklisted-email-text', null ];
99 $thisPageName =
$title->getPrefixedDBkey();
103 "Spam blacklist validator: [[$thisPageName]] not a local blacklist\n"
109 if (
$type ===
false ) {
113 $lines = explode(
"\n", $text );
118 "Spam blacklist validator: [[$thisPageName]] given invalid input lines: " .
119 implode(
', ', $badLines ) .
"\n"
122 $badList =
"*<code>" .
123 implode(
"</code>\n*<code>",
124 array_map(
'wfEscapeWikiText', $badLines ) ) .
127 "<div class='errorbox'>" .
128 wfMessage(
'spam-invalid-lines' )->numParams( $badLines )->text() .
"<br />" .
131 "<br clear='all' />\n";
134 "Spam blacklist validator: [[$thisPageName]] ok or empty blacklist\n"
179 $blacklist->clearCache();
202 $title = $upload->getTitle();
208 $links = array_keys(
$output->getExternalLinks() );
212 if ( preg_match(
'/\S(\.[^\s\d]{2,}|[\/@]\S)/', $comment ) ) {
227 'spamblacklist' => [
'matches' =>
$matches ],
static getSpamBlacklist()
static getBlacklistTypes()
Return the array of blacklist types currently defined.
static getInstance( $type)
Returns an instance of the given blacklist.
Class representing a MediaWiki article and history.
static isLocalSource(Title $title)
Check if the given local page title is a spam regex source.
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
static getTypeFromTitle(Title $title)
Returns the type of blacklist from the given title.
static getBadLines( $lines, BaseBlacklist $blacklist)
Returns an array of invalid lines.
wfDebugLog( $logGroup, $text, $dest='all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not.
static filterMergedContent(IContextSource $context, Content $content, Status $status, $summary, User $user, $minoredit)
Hook function for EditFilterMergedContent.
Extension of Message implementing IApiMessage.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
static validate(EditPage $editPage, $text, $section, &$hookError)
Hook function for EditFilter Confirm that a local blacklist page being saved is valid,...
getTitle()
Get the title object of the article.
static onParserOutputStashForEdit(WikiPage $page, Content $content, ParserOutput $output)
static makeContent( $text, Title $title=null, $modelId=null, $format=null)
Convenience function for creating a Content object from a given textual representation.
static newCanonical( $context=null, $userLang=null)
Creates a "canonical" ParserOptions object.
The edit page/HTML interface (split from Article) The actual database and text munging is still in Ar...
Interface for objects which can provide a MediaWiki context on request.
Base interface for content objects.
Hooks for the spam blacklist extension.
static getEmailBlacklist()
static userCanSendEmail(&$user, &$hookErr)
Verify that the user can send emails.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
static onUploadVerifyUpload(UploadBase $upload, User $user, $props, $comment, $pageText, &$error)
static pageSaveContent(WikiPage $wikiPage, User $user, Content $content, $summary, $isMinor, $isWatch, $section, $flags, $revision, Status $status, $baseRevId)
Hook function for PageContentSaveComplete Clear local spam blacklist caches on page save.