MediaWiki  1.34.4
SpamBlacklistHooks Class Reference

Hooks for the spam blacklist extension. More...

Static Public Member Functions

static filterMergedContent (IContextSource $context, Content $content, Status $status, $summary, User $user, $minoredit)
 Hook function for EditFilterMergedContent. More...
 
static onParserOutputStashForEdit (WikiPage $page, Content $content, ParserOutput $output)
 
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. More...
 
static userCanSendEmail (&$user, &$hookErr)
 Verify that the user can send emails. More...
 
static validate (EditPage $editPage, $text, $section, &$hookError)
 Hook function for EditFilter Confirm that a local blacklist page being saved is valid, and toss back a warning to the user if it isn't. More...
 

Detailed Description

Hooks for the spam blacklist extension.

Definition at line 6 of file SpamBlacklistHooks.php.

Member Function Documentation

◆ filterMergedContent()

static SpamBlacklistHooks::filterMergedContent ( IContextSource  $context,
Content  $content,
Status  $status,
  $summary,
User  $user,
  $minoredit 
)
static

Hook function for EditFilterMergedContent.

Parameters
IContextSource$context
Content$content
Status$status
string$summary
User$user
bool$minoredit
Returns
bool

Definition at line 19 of file SpamBlacklistHooks.php.

References $content, $context, $matches, $title, StatusValue\fatal(), BaseBlacklist\getSpamBlacklist(), Message\listParam(), and wfMessage().

◆ onParserOutputStashForEdit()

static SpamBlacklistHooks::onParserOutputStashForEdit ( WikiPage  $page,
Content  $content,
ParserOutput  $output 
)
static

◆ onUploadVerifyUpload()

static SpamBlacklistHooks::onUploadVerifyUpload ( UploadBase  $upload,
User  $user,
  $props,
  $comment,
  $pageText,
$error 
)
static
Parameters
UploadBase$upload
User$user
array | null$props
string$comment
string$pageText
array | ApiMessage&$error
Returns
bool

Definition at line 194 of file SpamBlacklistHooks.php.

References $content, $matches, $title, BaseBlacklist\getSpamBlacklist(), UploadBase\getTitle(), Message\listParam(), ContentHandler\makeContent(), ParserOptions\newCanonical(), and wfMessage().

◆ pageSaveContent()

static SpamBlacklistHooks::pageSaveContent ( WikiPage  $wikiPage,
User  $user,
Content  $content,
  $summary,
  $isMinor,
  $isWatch,
  $section,
  $flags,
  $revision,
Status  $status,
  $baseRevId 
)
static

Hook function for PageContentSaveComplete Clear local spam blacklist caches on page save.

Parameters
WikiPage$wikiPage
User$user
Content$content
string$summary
bool$isMinor
bool$isWatch
string$section
int$flags
Revision | null$revision
Status$status
int$baseRevId
Returns
bool

Definition at line 159 of file SpamBlacklistHooks.php.

References $type, BaseBlacklist\getBlacklistTypes(), BaseBlacklist\getInstance(), WikiPage\getTitle(), and BaseBlacklist\isLocalSource().

◆ userCanSendEmail()

static SpamBlacklistHooks::userCanSendEmail ( $user,
$hookErr 
)
static

Verify that the user can send emails.

Parameters
User&$user
array&$hookErr
Returns
bool

Definition at line 75 of file SpamBlacklistHooks.php.

References BaseBlacklist\getEmailBlacklist().

◆ validate()

static SpamBlacklistHooks::validate ( EditPage  $editPage,
  $text,
  $section,
$hookError 
)
static

Hook function for EditFilter Confirm that a local blacklist page being saved is valid, and toss back a warning to the user if it isn't.

Parameters
EditPage$editPage
string$text
string$section
string&$hookError
Returns
bool

Definition at line 97 of file SpamBlacklistHooks.php.

References $lines, $title, $type, SpamRegexBatch\getBadLines(), BaseBlacklist\getInstance(), EditPage\getTitle(), BaseBlacklist\getTypeFromTitle(), BaseBlacklist\isLocalSource(), wfDebugLog(), and wfMessage().


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