MediaWiki  1.29.2
SpamBlacklistHooks Class Reference

Hooks for the spam blacklist extension. More...

Static Public Member Functions

static abortNewAccount ( $user, &$abortError)
 Processes new accounts for valid email addresses. More...
 
static filterMergedContent (IContextSource $context, Content $content, Status $status, $summary, User $user, $minoredit)
 Hook function for EditFilterMergedContent. More...
 
static onArticleDelete (WikiPage &$article, User &$user, &$reason, &$error)
 
static onArticleDeleteComplete (&$page, User &$user, $reason, $id, Content $content=null, LogEntry $logEntry)
 
static onParserOutputStashForEdit (WikiPage $page, Content $content, ParserOutput $output)
 
static onUploadVerifyUpload (UploadBase $upload, User $user, array $props, $comment, $pageText, &$error)
 
static pageSaveContent (Page $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 registerExtension ()
 
static userCanSendEmail (&$user, &$hookErr)
 Verify that the user can send emails. More...
 
static validate ( $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 8 of file SpamBlacklistHooks.php.

Member Function Documentation

◆ abortNewAccount()

static SpamBlacklistHooks::abortNewAccount (   $user,
$abortError 
)
static

Processes new accounts for valid email addresses.

Parameters
$userUser
$abortError
Returns
bool

Definition at line 100 of file SpamBlacklistHooks.php.

References $user, BaseBlacklist\getInstance(), and wfMessage().

◆ 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 33 of file SpamBlacklistHooks.php.

References $content, $context, $matches, $status, $title, as, BaseBlacklist\getInstance(), ContextSource\getTitle(), and ContextSource\getWikiPage().

◆ onArticleDelete()

static SpamBlacklistHooks::onArticleDelete ( WikiPage $article,
User $user,
$reason,
$error 
)
static
Parameters
WikiPage$article
User$user
$reason
$error

Definition at line 262 of file SpamBlacklistHooks.php.

References $article, and BaseBlacklist\getInstance().

◆ onArticleDeleteComplete()

static SpamBlacklistHooks::onArticleDeleteComplete ( $page,
User $user,
  $reason,
  $id,
Content  $content = null,
LogEntry  $logEntry 
)
static
Parameters
WikiPage$page
User$user
$reason
$id
Content | null$content
LogEntry$logEntry

Definition at line 283 of file SpamBlacklistHooks.php.

References $page, $user, and BaseBlacklist\getInstance().

◆ onParserOutputStashForEdit()

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

Definition at line 66 of file SpamBlacklistHooks.php.

References $output, $page, and BaseBlacklist\getInstance().

◆ onUploadVerifyUpload()

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

Definition at line 218 of file SpamBlacklistHooks.php.

References $content, $matches, $output, $title, array(), BaseBlacklist\getInstance(), ContentHandler\makeContent(), and wfMessage().

◆ pageSaveContent()

static SpamBlacklistHooks::pageSaveContent ( Page  $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
Page$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 177 of file SpamBlacklistHooks.php.

References $type, $user, as, BaseBlacklist\getBlacklistTypes(), BaseBlacklist\getInstance(), and BaseBlacklist\isLocalSource().

◆ registerExtension()

static SpamBlacklistHooks::registerExtension ( )
static

Definition at line 10 of file SpamBlacklistHooks.php.

References class, global, and Hooks\register().

◆ userCanSendEmail()

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

Verify that the user can send emails.

Parameters
$userUser
$hookErrarray
Returns
bool

Definition at line 81 of file SpamBlacklistHooks.php.

References $user, array(), and BaseBlacklist\getInstance().

◆ validate()

static SpamBlacklistHooks::validate (   $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
$editPageEditPage
$textstring
$sectionstring
$hookErrorstring
Returns
bool

Definition at line 122 of file SpamBlacklistHooks.php.

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


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