MediaWiki  1.34.4
TitleBlacklistEntry Class Reference

Represents a title blacklist entry. More...

Public Member Functions

 getCustomMessage ()
 
 getErrorMessage ( $operation)
 Return the error message name for the blacklist entry. More...
 
 getFormatVersion ()
 
 getParams ()
 
 getRaw ()
 
 getRegex ()
 
 matches ( $title, $action)
 Check whether a user can perform the specified action on the specified Title. More...
 
 setFormatVersion ( $v)
 Set the format version. More...
 

Static Public Member Functions

static newFromString ( $line, $source)
 Create a new TitleBlacklistEntry from a line of text. More...
 

Private Member Functions

 __construct ( $regex, $params, $raw, $source)
 
 filtersNewAccounts ()
 Returns whether this entry is capable of filtering new accounts. More...
 

Private Attributes

string $mFormatVersion
 Entry format version. More...
 
array $mParams
 Parameters for this entry. More...
 
string $mRaw
 Raw line. More...
 
string $mRegex
 Regular expression to match. More...
 
string $mSource
 Source of this entry. More...
 

Detailed Description

Represents a title blacklist entry.

Definition at line 19 of file TitleBlacklistEntry.php.

Constructor & Destructor Documentation

◆ __construct()

TitleBlacklistEntry::__construct (   $regex,
  $params,
  $raw,
  $source 
)
private
Parameters
string$regexRegular expression to match
array$paramsParameters for this entry
string$rawRaw contents of this line
string$source

Definition at line 56 of file TitleBlacklistEntry.php.

References $source, and TitleBlacklist\VERSION.

Member Function Documentation

◆ filtersNewAccounts()

TitleBlacklistEntry::filtersNewAccounts ( )
private

Returns whether this entry is capable of filtering new accounts.

Definition at line 67 of file TitleBlacklistEntry.php.

Referenced by matches().

◆ getCustomMessage()

TitleBlacklistEntry::getCustomMessage ( )
Returns
string Custom message for this entry

Definition at line 260 of file TitleBlacklistEntry.php.

Referenced by getErrorMessage().

◆ getErrorMessage()

TitleBlacklistEntry::getErrorMessage (   $operation)

Return the error message name for the blacklist entry.

Parameters
string$operationOperation name (as in titleblacklist-forbidden message name)
Returns
string The error message name

Definition at line 287 of file TitleBlacklistEntry.php.

References getCustomMessage().

◆ getFormatVersion()

TitleBlacklistEntry::getFormatVersion ( )
Returns
string The format version

Definition at line 267 of file TitleBlacklistEntry.php.

References $mFormatVersion.

◆ getParams()

TitleBlacklistEntry::getParams ( )
Returns
array This entry's parameters

Definition at line 253 of file TitleBlacklistEntry.php.

References $mParams.

◆ getRaw()

TitleBlacklistEntry::getRaw ( )
Returns
string This entry's raw line

Definition at line 246 of file TitleBlacklistEntry.php.

References $mRaw.

◆ getRegex()

TitleBlacklistEntry::getRegex ( )
Returns
string This entry's regular expression

Definition at line 239 of file TitleBlacklistEntry.php.

References $mRegex.

◆ matches()

TitleBlacklistEntry::matches (   $title,
  $action 
)

Check whether a user can perform the specified action on the specified Title.

Parameters
string$titleTitle to check
string$actionAction to check
Returns
bool TRUE if the regex matches the title, and is not overridden else false if it doesn't match (or was overridden)

Definition at line 94 of file TitleBlacklistEntry.php.

References $cache, $title, filtersNewAccounts(), and wfDebugLog().

◆ newFromString()

static TitleBlacklistEntry::newFromString (   $line,
  $source 
)
static

Create a new TitleBlacklistEntry from a line of text.

Parameters
string$lineString containing a line of blacklist text
string$source
Returns
TitleBlacklistEntry|null

Definition at line 162 of file TitleBlacklistEntry.php.

References $line, $matches, $source, $wgParser, CoreParserFunctions\ns(), and wfMessage().

Referenced by TitleBlacklist\parseBlacklist().

◆ setFormatVersion()

TitleBlacklistEntry::setFormatVersion (   $v)

Set the format version.

Parameters
string$vNew version to set

Definition at line 276 of file TitleBlacklistEntry.php.

Member Data Documentation

◆ $mFormatVersion

string TitleBlacklistEntry::$mFormatVersion
private

Entry format version.

Definition at line 42 of file TitleBlacklistEntry.php.

Referenced by getFormatVersion().

◆ $mParams

array TitleBlacklistEntry::$mParams
private

Parameters for this entry.

Definition at line 36 of file TitleBlacklistEntry.php.

Referenced by getParams().

◆ $mRaw

string TitleBlacklistEntry::$mRaw
private

Raw line.

Definition at line 24 of file TitleBlacklistEntry.php.

Referenced by getRaw().

◆ $mRegex

string TitleBlacklistEntry::$mRegex
private

Regular expression to match.

Definition at line 30 of file TitleBlacklistEntry.php.

Referenced by getRegex().

◆ $mSource

string TitleBlacklistEntry::$mSource
private

Source of this entry.

Definition at line 48 of file TitleBlacklistEntry.php.


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