31 $pout = $editInfo->output;
32 $links = array_keys( $pout->getExternalLinks() );
36 if ( preg_match(
'/\S(\.[^\s\d]{2,}|[\/@]\S)/', $summary ) ) {
48 'spamblacklist' => [
'matches' =>
$matches ],
51 $status->
fatal( $error );
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();
206 $parserOptions = ParserOptions::newCanonical(
'canonical' );
207 $output =
$content->getParserOutput(
$title,
null, $parserOptions );
208 $links = array_keys( $output->getExternalLinks() );
212 if ( preg_match(
'/\S(\.[^\s\d]{2,}|[\/@]\S)/', $comment ) ) {
227 'spamblacklist' => [
'matches' =>
$matches ],
wfDebugLog( $logGroup, $text, $dest='all', array $context=[])
Send a line to a supplementary debug log file, if configured, or main debug log if not.
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Extension of Message implementing IApiMessage.
static getBlacklistTypes()
Return the array of blacklist types currently defined.
static getEmailBlacklist()
static getSpamBlacklist()
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.
The edit page/HTML interface (split from Article) The actual database and text munging is still in Ar...
static listParam(array $list, $type='text')
Hooks for the spam blacklist extension.
static filterMergedContent(IContextSource $context, Content $content, Status $status, $summary, User $user, $minoredit)
Hook function for EditFilterMergedContent.
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.
static onUploadVerifyUpload(UploadBase $upload, User $user, $props, $comment, $pageText, &$error)
static onParserOutputStashForEdit(WikiPage $page, Content $content, ParserOutput $output)
static userCanSendEmail(&$user, &$hookErr)
Verify that the user can send emails.
static validate(EditPage $editPage, $text, $section, &$hookError)
Hook function for EditFilter Confirm that a local blacklist page being saved is valid,...
static getBadLines( $lines, BaseBlacklist $blacklist)
Returns an array of invalid lines.
fatal( $message,... $parameters)
Add an error and set OK to false, indicating that the operation as a whole was fatal.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
UploadBase and subclasses are the backend of MediaWiki's file uploads.
getTitle()
Returns the title of the file to be uploaded.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Class representing a MediaWiki article and history.
getTitle()
Get the title object of the article.
Base interface for content objects.
Interface for objects which can provide a MediaWiki context on request.