Go to the documentation of this file.
33 parent::__construct( $query, $moduleName,
'tb' );
38 $action = $params[
'action'];
39 $override = !$params[
'nooverride'];
42 if ( $action ===
'createpage' || $action ===
'createtalk' ) {
59 htmlspecialchars( $blacklisted->getRaw() ),
60 htmlspecialchars( $params[
'title'] ),
64 $res->addValue(
'titleblacklist',
'result',
'blacklisted' );
66 $message = $blacklisted->getErrorMessage( $action !==
'create' ? $action :
'edit' );
67 $res->addValue(
'titleblacklist',
'reason',
wfMessage( $message, $result )->text() );
68 $res->addValue(
'titleblacklist',
'message', $message );
69 $res->addValue(
'titleblacklist',
'line', htmlspecialchars( $blacklisted->getRaw() ) );
72 $this->
getResult()->addValue(
'titleblacklist',
'result',
'ok' );
86 'create',
'edit',
'upload',
'createtalk',
'createpage',
'move',
'new-account'
101 'action=titleblacklist&tbtitle=Foo'
102 =>
'apihelp-titleblacklist-example-1',
103 'action=titleblacklist&tbtitle=Bar&tbaction=edit'
104 =>
'apihelp-titleblacklist-example-2',
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
const PARAM_REQUIRED
(boolean) Is the parameter required?
static singleton()
Get an instance of this class.
dieWithError( $msg, $code=null, $data=null, $httpCode=null)
Abort execution with an error.
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
getResult()
Get the result object.
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
This abstract class implements many basic API functions, and is the base of all API classes.
Represents a title blacklist entry.
extractRequestParams( $options=[])
Using getAllowedParams(), this function makes an array of the values provided by the user,...
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
execute()
Evaluates the parameters, performs the requested query, and sets up the result.
__construct( $query, $moduleName)
TitleBlacklist extension API.
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
const PARAM_ISMULTI
(boolean) Accept multiple pipe-separated values for this parameter (e.g.
getAllowedParams()
Returns an array of allowed parameters (parameter name) => (default value) or (parameter name) => (ar...