MediaWiki REL1_34
|
Implements a title blacklist for MediaWiki. More...
Public Member Functions | |
getBlacklist () | |
Get the current blacklist. | |
getWhitelist () | |
Get the current whitelist. | |
invalidate () | |
Invalidate the blacklist cache. | |
isBlacklisted ( $title, $action='edit') | |
Check whether the blacklist restricts performing a specific action on the given Title. | |
isWhitelisted ( $title, $action='edit') | |
Check whether it has been explicitly whitelisted that the current User may perform a specific action on the given Title. | |
load () | |
Load all configured blacklist sources. | |
loadWhitelist () | |
Load local whitelist. | |
userCannot ( $title, $user, $action='edit', $override=true) | |
Check whether the blacklist restricts given user performing a specific action on the given Title. | |
validate (array $blacklist) | |
Validate a new blacklist. | |
Static Public Member Functions | |
static | destroySingleton () |
Destroy/reset the current singleton instance. | |
static | parseBlacklist ( $list, $sourceName) |
Parse blacklist from a string. | |
static | singleton () |
Get an instance of this class. | |
static | userCanOverride ( $user, $action) |
Inidcates whether user can override blacklist on certain action. | |
Public Attributes | |
const | VERSION = 3 |
Static Protected Attributes | |
static TitleBlacklist | $instance = null |
Static Private Member Functions | |
static | getBlacklistText ( $source) |
Get the text of a blacklist from a specified source. | |
static | getHttp ( $url) |
Get the text of a blacklist source via HTTP. | |
Private Attributes | |
TitleBlacklistEntry[] | $mBlacklist = null |
TitleBlacklistEntry[] | $mWhitelist = null |
Implements a title blacklist for MediaWiki.
Definition at line 19 of file TitleBlacklist.php.
|
static |
Destroy/reset the current singleton instance.
This is solely for testing and will fail unless MW_PHPUNIT_TEST is defined.
Definition at line 49 of file TitleBlacklist.php.
Referenced by ApiQueryTitleBlacklistTest\setUp(), and ApiQueryTitleBlacklistTest\tearDown().
TitleBlacklist::getBlacklist | ( | ) |
Get the current blacklist.
Definition at line 264 of file TitleBlacklist.php.
References $mBlacklist, and load().
Referenced by isBlacklisted().
|
staticprivate |
Get the text of a blacklist from a specified source.
array | $source | A blacklist source from $wgTitleBlacklistSources |
Definition at line 117 of file TitleBlacklist.php.
References $source, $title, getHttp(), NS_MEDIAWIKI, and wfMessage().
|
staticprivate |
Get the text of a blacklist source via HTTP.
string | $url | URL of the blacklist source |
Definition at line 289 of file TitleBlacklist.php.
References $messageMemc.
Referenced by getBlacklistText().
TitleBlacklist::getWhitelist | ( | ) |
Get the current whitelist.
Definition at line 276 of file TitleBlacklist.php.
References $mWhitelist, and loadWhitelist().
Referenced by isWhitelisted().
TitleBlacklist::invalidate | ( | ) |
Invalidate the blacklist cache.
Definition at line 311 of file TitleBlacklist.php.
References $cache.
TitleBlacklist::isBlacklisted | ( | $title, | |
$action = 'edit' ) |
Check whether the blacklist restricts performing a specific action on the given Title.
Definition at line 210 of file TitleBlacklist.php.
References $title, getBlacklist(), and isWhitelisted().
Referenced by userCannot().
TitleBlacklist::isWhitelisted | ( | $title, | |
$action = 'edit' ) |
Check whether it has been explicitly whitelisted that the current User may perform a specific action on the given Title.
Definition at line 246 of file TitleBlacklist.php.
References $title, and getWhitelist().
Referenced by isBlacklisted().
TitleBlacklist::load | ( | ) |
Load all configured blacklist sources.
Definition at line 63 of file TitleBlacklist.php.
References $cache, $source, and wfDebugLog().
Referenced by getBlacklist().
TitleBlacklist::loadWhitelist | ( | ) |
Load local whitelist.
Definition at line 94 of file TitleBlacklist.php.
References $cache, parseBlacklist(), and wfMessage().
Referenced by getWhitelist().
|
static |
Parse blacklist from a string.
string | $list | Text of a blacklist source |
string | $sourceName |
Definition at line 162 of file TitleBlacklist.php.
References $line, $lines, and TitleBlacklistEntry\newFromString().
Referenced by loadWhitelist(), and TitleBlacklistHooks\onValidateBlacklist().
|
static |
Get an instance of this class.
Definition at line 36 of file TitleBlacklist.php.
References $instance.
Referenced by ApiQueryTitleBlacklist\execute(), TitleBlacklistHooks\onClearBlacklist(), TitleBlacklistHooks\onDisplayBlacklistOverrideNotice(), TitleBlacklistHooks\onMovePageCheckPermissions(), TitleBlacklistHooks\onUserCan(), TitleBlacklistHooks\onValidateBlacklist(), Scribunto_LuaTitleBlacklistLibrary\test(), and TitleBlacklistHooks\testUserName().
TitleBlacklist::userCannot | ( | $title, | |
$user, | |||
$action = 'edit', | |||
$override = true ) |
Check whether the blacklist restricts given user performing a specific action on the given Title.
Title | $title | Title to check |
User | $user | User to check |
string | $action | Action to check; 'edit' if unspecified |
bool | $override | If set to true, overrides work |
Definition at line 186 of file TitleBlacklist.php.
References $title, and isBlacklisted().
|
static |
Inidcates whether user can override blacklist on certain action.
Definition at line 344 of file TitleBlacklist.php.
Referenced by TitleBlacklistPreAuthenticationProvider\getAuthenticationRequests().
TitleBlacklist::validate | ( | array | $blacklist | ) |
Validate a new blacklist.
PhanParamSuspiciousOrder The preg_match() params are in the correct order
TitleBlacklistEntry[] | $blacklist |
Definition at line 323 of file TitleBlacklist.php.
|
staticprotected |
Definition at line 27 of file TitleBlacklist.php.
Referenced by singleton().
|
private |
Definition at line 21 of file TitleBlacklist.php.
Referenced by getBlacklist().
|
private |
Definition at line 24 of file TitleBlacklist.php.
Referenced by getWhitelist().
const TitleBlacklist::VERSION = 3 |
Definition at line 29 of file TitleBlacklist.php.
Referenced by TitleBlacklistEntry\__construct().