MediaWiki  1.29.1
TitleBlacklist.hooks.php
Go to the documentation of this file.
1 <?php
9 use MediaWiki\Auth\AuthManager;
10 
17 
21  public static function onRegistration() {
22  global $wgDisableAuthManager, $wgAuthManagerAutoConfig;
23 
24  if ( class_exists( AuthManager::class ) && !$wgDisableAuthManager ) {
25  $wgAuthManagerAutoConfig['preauth'][TitleBlacklistPreAuthenticationProvider::class] =
27  } else {
28  Hooks::register( 'AbortNewAccount', 'TitleBlacklistHooks::abortNewAccount' );
29  Hooks::register( 'AbortAutoAccount', 'TitleBlacklistHooks::abortAutoAccount' );
30  Hooks::register( 'UserCreateForm', 'TitleBlacklistHooks::addOverrideCheckbox' );
31  Hooks::register( 'APIGetAllowedParams', 'TitleBlacklistHooks::onAPIGetAllowedParams' );
32  Hooks::register( 'AddNewAccountApiForm', 'TitleBlacklistHooks::onAddNewAccountApiForm' );
33  }
34  }
35 
45  public static function userCan( $title, $user, $action, &$result ) {
46  # Some places check createpage, while others check create.
47  # As it stands, upload does createpage, but normalize both
48  # to the same action, to stop future similar bugs.
49  if ( $action === 'createpage' || $action === 'createtalk' ) {
50  $action = 'create';
51  }
52  if ( $action == 'create' || $action == 'edit' || $action == 'upload' ) {
53  $blacklisted = TitleBlacklist::singleton()->userCannot( $title, $user, $action );
54  if ( $blacklisted instanceof TitleBlacklistEntry ) {
55  $errmsg = $blacklisted->getErrorMessage( 'edit' );
56  $params = array(
57  $blacklisted->getRaw(),
58  $title->getFullText()
59  );
62  wfMessage(
63  $errmsg,
64  htmlspecialchars( $blacklisted->getRaw() ),
65  $title->getFullText()
66  ),
67  'titleblacklist-forbidden',
68  array(
69  'message' => array(
70  'key' => $errmsg,
71  'params' => $params,
72  ),
73  'line' => $blacklisted->getRaw(),
74  // As $errmsg usually represents a non-default message here, and ApiBase uses
75  // ->inLanguage( 'en' )->useDatabase( false ) for all messages, it will never result in
76  // useful 'info' text in the API. Try this, extra data seems to override the default.
77  'info' => 'TitleBlacklist prevents this title from being created',
78  )
79  );
80  return false;
81  }
82  }
83  return true;
84  }
85 
94  public static function displayBlacklistOverrideNotice( Title $title, $oldid, array &$notices ) {
95  if ( !RequestContext::getMain()->getUser()->isAllowed( 'tboverride' ) ) {
96  return true;
97  }
98 
99  $blacklisted = TitleBlacklist::singleton()->isBlacklisted(
100  $title,
101  $title->exists() ? 'edit' : 'create'
102  );
103  if ( !$blacklisted ) {
104  return true;
105  }
106 
107  $params = $blacklisted->getParams();
108  if ( isset( $params['autoconfirmed'] ) ) {
109  return true;
110  }
111 
112  $msg = wfMessage( 'titleblacklist-warning' );
113  $notices['titleblacklist'] = $msg->rawParams(
114  htmlspecialchars( $blacklisted->getRaw() ) )->parseAsBlock();
115  return true;
116  }
117 
128  public static function onMovePageCheckPermissions( Title $oldTitle, Title $newTitle, User $user, $reason, Status $status ) {
129  $titleBlacklist = TitleBlacklist::singleton();
130  $blacklisted = $titleBlacklist->userCannot( $newTitle, $user, 'move' );
131  if ( !$blacklisted ) {
132  $blacklisted = $titleBlacklist->userCannot( $oldTitle, $user, 'edit' );
133  }
134  if ( $blacklisted instanceof TitleBlacklistEntry ) {
135  $status->fatal( ApiMessage::create( [
136  $blacklisted->getErrorMessage( 'move' ),
137  $blacklisted->getRaw(),
138  $oldTitle->getFullText(),
139  $newTitle->getFullText()
140  ] ) );
141  return false;
142  }
143 
144  return true;
145  }
146 
156  public static function acceptNewUserName( $userName, $permissionsUser, &$err, $override = true, $log = false ) {
157  $sv = self::testUserName( $userName, $permissionsUser, $override, $log );
158  if ( !$sv->isGood() ) {
159  $err = Status::wrap( $sv )->getMessage()->parse();
160  }
161  return $sv->isGood();
162  }
163 
174  public static function testUserName( $userName, User $creatingUser, $override = true, $log = false ) {
175  $title = Title::makeTitleSafe( NS_USER, $userName );
176  $blacklisted = TitleBlacklist::singleton()->userCannot( $title, $creatingUser,
177  'new-account', $override );
178  if ( $blacklisted instanceof TitleBlacklistEntry ) {
179  if ( $log ) {
180  self::logFilterHitUsername( $creatingUser, $title, $blacklisted->getRaw() );
181  }
182  $message = $blacklisted->getErrorMessage( 'new-account' );
183  $params = [
184  $blacklisted->getRaw(),
185  $userName,
186  ];
189  [ $message, $blacklisted->getRaw(), $userName ],
190  'titleblacklist-forbidden',
191  [
192  'message' => [
193  'key' => $message,
194  'params' => $params,
195  ],
196  'line' => $blacklisted->getRaw(),
197  // The text of the message probably isn't useful API info, so do this instead
198  'info' => 'TitleBlacklist prevents this username from being created',
199  ]
200  ) );
201  }
202  return StatusValue::newGood();
203  }
204 
213  public static function abortNewAccount( $user, &$message, &$status ) {
215  $override = $wgRequest->getCheck( 'wpIgnoreTitleBlacklist' );
216  $sv = self::testUserName( $user->getName(), $wgUser, $override, true );
217  if ( !$sv->isGood() ) {
218  $status = Status::wrap( $sv );
219  $message = $status->getMessage()->parse();
220  }
221  return $sv->isGood();
222  }
223 
231  public static function abortAutoAccount( $user, &$message ) {
232  global $wgTitleBlacklistBlockAutoAccountCreation;
233  if ( $wgTitleBlacklistBlockAutoAccountCreation ) {
234  return self::abortNewAccount( $user, $message );
235  }
236  return true;
237  }
238 
244  public static function validateBlacklist( $editor, $text, $section, &$error ) {
245  global $wgUser;
246  $title = $editor->mTitle;
247 
248  if ( $title->getNamespace() == NS_MEDIAWIKI && $title->getDBkey() == 'Titleblacklist' ) {
249 
250  $blackList = TitleBlacklist::singleton();
251  $bl = $blackList->parseBlacklist( $text, 'page' );
252  $ok = $blackList->validate( $bl );
253  if ( count( $ok ) == 0 ) {
254  return true;
255  }
256 
257  $errmsg = wfMessage( 'titleblacklist-invalid' )->numParams( count( $ok ) )->text();
258  $errlines = '* <code>' . implode( "</code>\n* <code>", array_map( 'wfEscapeWikiText', $ok ) ) . '</code>';
259  $error = Html::openElement( 'div', array( 'class' => 'errorbox' ) ) .
260  $errmsg .
261  "\n" .
262  $errlines .
263  Html::closeElement( 'div' ) . "\n" .
264  Html::element( 'br', array( 'clear' => 'all' ) ) . "\n";
265 
266  // $error will be displayed by the edit class
267  }
268  return true;
269  }
270 
276  public static function clearBlacklist( &$article, &$user,
277  $content, $summary, $isminor, $iswatch, $section )
278  {
279  $title = $article->getTitle();
280  if ( $title->getNamespace() == NS_MEDIAWIKI && $title->getDBkey() == 'Titleblacklist' ) {
281  TitleBlacklist::singleton()->invalidate();
282  }
283  return true;
284  }
285 
287  public static function addOverrideCheckbox( &$template ) {
289 
290  if ( TitleBlacklist::userCanOverride( $wgUser, 'new-account' ) ) {
291  $template->addInputItem( 'wpIgnoreTitleBlacklist',
292  $wgRequest->getCheck( 'wpIgnoreTitleBlacklist' ),
293  'checkbox', 'titleblacklist-override' );
294  }
295  return true;
296  }
297 
303  public static function onAPIGetAllowedParams( ApiBase &$module, array &$params ) {
304  if ( $module instanceof ApiCreateAccount ) {
305  $params['ignoretitleblacklist'] = array(
306  ApiBase::PARAM_TYPE => 'boolean',
307  ApiBase::PARAM_DFLT => false
308  );
309  }
310 
311  return true;
312  }
313 
322  public static function onAddNewAccountApiForm( ApiBase $apiModule, LoginForm $loginForm ) {
324  $main = $apiModule->getMain();
325 
326  if ( $main->getVal( 'ignoretitleblacklist' ) !== null ) {
327  $wgRequest->setVal( 'wpIgnoreTitleBlacklist', '1' );
328 
329  // Suppress "unrecognized parameter" warning:
330  $main->getVal( 'wpIgnoreTitleBlacklist' );
331  }
332 
333  return true;
334  }
335 
344  public static function logFilterHitUsername( $user, $title, $entry ) {
345  global $wgTitleBlacklistLogHits;
346  if ( $wgTitleBlacklistLogHits ) {
347  $logEntry = new ManualLogEntry( 'titleblacklist', 'hit-username' );
348  $logEntry->setPerformer( $user );
349  $logEntry->setTarget( $title );
350  $logEntry->setParameters( array(
351  '4::entry' => $entry,
352  ) );
353  $logid = $logEntry->insert();
354  $logEntry->publish( $logid );
355  }
356  }
357 
365  public static function scribuntoExternalLibraries( $engine, array &$extraLibraries ) {
366  if( $engine == 'lua' ) {
367  $extraLibraries['mw.ext.TitleBlacklist'] = 'Scribunto_LuaTitleBlacklistLibrary';
368  }
369  return true;
370  }
371 }
TitleBlacklistHooks::validateBlacklist
static validateBlacklist( $editor, $text, $section, &$error)
EditFilter hook.
Definition: TitleBlacklist.hooks.php:244
$wgUser
$wgUser
Definition: Setup.php:781
$template
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping $template
Definition: hooks.txt:783
TitleBlacklistHooks::clearBlacklist
static clearBlacklist(&$article, &$user, $content, $summary, $isminor, $iswatch, $section)
PageContentSaveComplete hook.
Definition: TitleBlacklist.hooks.php:276
TitleBlacklistHooks::onAddNewAccountApiForm
static onAddNewAccountApiForm(ApiBase $apiModule, LoginForm $loginForm)
Pass API parameter on to the login form when using API account creation.
Definition: TitleBlacklist.hooks.php:322
TitleBlacklist::singleton
static singleton()
Get an instance of this class.
Definition: TitleBlacklist.list.php:31
TitleBlacklistHooks::addOverrideCheckbox
static addOverrideCheckbox(&$template)
UserCreateForm hook based on the one from AntiSpoof extension.
Definition: TitleBlacklist.hooks.php:287
captcha-old.count
count
Definition: captcha-old.py:225
$result
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. Return false to stop further processing of the tag $reader:XMLReader object $logInfo:Array of information 'ImportHandlePageXMLTag':When parsing a XML tag in a page. Return false to stop further processing of the tag $reader:XMLReader object & $pageInfo:Array of information 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. Return false to stop further processing of the tag $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. Return false to stop further processing of the tag $reader:XMLReader object 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. Return false to stop further processing of the tag $reader:XMLReader object $revisionInfo:Array of information 'ImportLogInterwikiLink':Hook to change the interwiki link used in log entries and edit summaries for transwiki imports. & $fullInterwikiPrefix:Interwiki prefix, may contain colons. & $pageTitle:String that contains page title. 'ImportSources':Called when reading from the $wgImportSources configuration variable. Can be used to lazy-load the import sources list. & $importSources:The value of $wgImportSources. Modify as necessary. See the comment in DefaultSettings.php for the detail of how to structure this array. 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. & $title:Title object for the current page & $request:WebRequest & $ignoreRedirect:boolean to skip redirect check & $target:Title/string of redirect target & $article:Article object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) & $article:article(object) being checked 'IsTrustedProxy':Override the result of IP::isTrustedProxy() & $ip:IP being check & $result:Change this value to override the result of IP::isTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of Sanitizer::validateEmail(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetMagic':DEPRECATED! Use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language & $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetSpecialPageAliases':DEPRECATED! Use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language & $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code:language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Array with elements of the form "language:title" in the order that they will be output. & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LanguageSelector':Hook to change the language selector available on a page. $out:The output page. $cssClassName:CSS class name of the language selector. 'LinkBegin':DEPRECATED! Use HtmlPageLinkRendererBegin instead. Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
Definition: hooks.txt:1954
ApiBase\PARAM_TYPE
const PARAM_TYPE
(string|string[]) Either an array of allowed value strings, or a string type as described below.
Definition: ApiBase.php:91
$status
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set $status
Definition: hooks.txt:1049
TitleBlacklistHooks::displayBlacklistOverrideNotice
static displayBlacklistOverrideNotice(Title $title, $oldid, array &$notices)
Display a notice if a user is only able to create or edit a page because they have tboverride.
Definition: TitleBlacklist.hooks.php:94
use
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
Definition: MIT-LICENSE.txt:10
$user
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
Definition: hooks.txt:246
StatusValue\newFatal
static newFatal( $message)
Factory function for fatal errors.
Definition: StatusValue.php:63
TitleBlacklistHooks::logFilterHitUsername
static logFilterHitUsername( $user, $title, $entry)
Logs the filter username hit to Special:Log if $wgTitleBlacklistLogHits is enabled.
Definition: TitleBlacklist.hooks.php:344
$params
$params
Definition: styleTest.css.php:40
php
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
Definition: injection.txt:35
ApiBase
This abstract class implements many basic API functions, and is the base of all API classes.
Definition: ApiBase.php:41
TitleBlacklistHooks
Hooks for the TitleBlacklist class.
Definition: TitleBlacklist.hooks.php:16
Status
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition: Status.php:40
Html\closeElement
static closeElement( $element)
Returns "</$element>".
Definition: Html.php:309
TitleBlacklistHooks::abortNewAccount
static abortNewAccount( $user, &$message, &$status)
AbortNewAccount hook.
Definition: TitleBlacklist.hooks.php:213
$title
namespace and then decline to actually register it file or subcat img or subcat $title
Definition: hooks.txt:934
TitleBlacklistHooks::onMovePageCheckPermissions
static onMovePageCheckPermissions(Title $oldTitle, Title $newTitle, User $user, $reason, Status $status)
MovePageCheckPermissions hook (1.25+)
Definition: TitleBlacklist.hooks.php:128
Status\wrap
static wrap( $sv)
Succinct helper method to wrap a StatusValue.
Definition: Status.php:55
$content
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist Do not use this to implement individual filters if they are compatible with the ChangesListFilter and ChangesListFilterGroup structure use sub classes of those in conjunction with the ChangesListSpecialPageStructuredFilters hook This hook can be used to implement filters that do not implement that or custom behavior that is not an individual filter e g Watchlist and Watchlist you will want to construct new ChangesListBooleanFilter or ChangesListStringOptionsFilter objects When constructing you specify which group they belong to You can reuse existing or create your you must register them with $special registerFilterGroup removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set and then return false from the hook function Ensure you consume the ChangeTagAfterDelete hook to carry out custom deletion actions as context called by AbstractContent::getParserOutput May be used to override the normal model specific rendering of page content $content
Definition: hooks.txt:1049
TitleBlacklistHooks::acceptNewUserName
static acceptNewUserName( $userName, $permissionsUser, &$err, $override=true, $log=false)
Check whether a user name is acceptable, and set a message if unacceptable.
Definition: TitleBlacklist.hooks.php:156
$oldTitle
versus $oldTitle
Definition: globals.txt:16
TitleBlacklistEntry
Represents a title blacklist entry.
Definition: TitleBlacklist.list.php:333
Title\getFullText
getFullText()
Get the prefixed title with spaces, plus any fragment (part beginning with '#')
Definition: Title.php:1475
$engine
the value to return A Title object or null for latest all implement SearchIndexField $engine
Definition: hooks.txt:2782
global
when a variable name is used in a it is silently declared as a new masking the global
Definition: design.txt:93
LoginForm
LoginForm as a special page has been replaced by SpecialUserLogin and SpecialCreateAccount,...
Definition: LoginSignupSpecialPage.php:1443
ApiMessage\create
static create( $msg, $code=null, array $data=null)
Create an IApiMessage for the message.
Definition: ApiMessage.php:212
$editor
passed in as a query string parameter to the various URLs constructed here(i.e. $prevlink) $ldel you ll need to handle error etc yourself modifying $error and returning true will cause the contents of $error to be echoed at the top of the edit form as wikitext Return true without altering $error to allow the edit to proceed & $editor
Definition: hooks.txt:1252
TitleBlacklistHooks::abortAutoAccount
static abortAutoAccount( $user, &$message)
AbortAutoAccount hook.
Definition: TitleBlacklist.hooks.php:231
Title\makeTitleSafe
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:538
TitleBlacklistHooks::scribuntoExternalLibraries
static scribuntoExternalLibraries( $engine, array &$extraLibraries)
External Lua library for Scribunto.
Definition: TitleBlacklist.hooks.php:365
ApiResult\setIndexedTagName
static setIndexedTagName(array &$arr, $tag)
Set the tag name for numeric-keyed values in XML format.
Definition: ApiResult.php:616
Hooks\register
static register( $name, $callback)
Attach an event handler to a given hook.
Definition: Hooks.php:49
StatusValue\newGood
static newGood( $value=null)
Factory function for good results.
Definition: StatusValue.php:76
RequestContext\getMain
static getMain()
Static methods.
Definition: RequestContext.php:468
TitleBlacklist::userCanOverride
static userCanOverride( $user, $action)
Inidcates whether user can override blacklist on certain action.
Definition: TitleBlacklist.list.php:323
Title
Represents a title within MediaWiki.
Definition: Title.php:39
$section
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template $section
Definition: hooks.txt:2929
TitleBlacklistHooks::onRegistration
static onRegistration()
Called right after configuration variables have been set.
Definition: TitleBlacklist.hooks.php:21
ApiBase\PARAM_DFLT
const PARAM_DFLT
(null|boolean|integer|string) Default value of the parameter.
Definition: ApiBase.php:52
Html\openElement
static openElement( $element, $attribs=[])
Identical to rawElement(), but has no third parameter and omits the end tag (and the self-closing '/'...
Definition: Html.php:251
$article
Using a hook running we can avoid having all this option specific stuff in our mainline code Using the function array $article
Definition: hooks.txt:78
NS_USER
const NS_USER
Definition: Defines.php:64
true
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
Definition: hooks.txt:1956
ManualLogEntry
Class for creating log entries manually, to inject them into the database.
Definition: LogEntry.php:396
ApiBase\getMain
getMain()
Get the main module.
Definition: ApiBase.php:506
wfMessage
either a unescaped string or a HtmlArmor object after in associative array form externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock() - offset Set to overwrite offset parameter in $wgRequest set to '' to unset offset - wrap String Wrap the message in html(usually something like "&lt
NS_MEDIAWIKI
const NS_MEDIAWIKI
Definition: Defines.php:70
class
you have access to all of the normal MediaWiki so you can get a DB use the etc For full docs on the Maintenance class
Definition: maintenance.txt:52
TitleBlacklistHooks::userCan
static userCan( $title, $user, $action, &$result)
getUserPermissionsErrorsExpensive hook
Definition: TitleBlacklist.hooks.php:45
$wgRequest
if(! $wgDBerrorLogTZ) $wgRequest
Definition: Setup.php:639
TitleBlacklistHooks::testUserName
static testUserName( $userName, User $creatingUser, $override=true, $log=false)
Check whether a user name is acceptable for account creation or autocreation, and explain why not if ...
Definition: TitleBlacklist.hooks.php:174
Html\element
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
Definition: Html.php:231
TitleBlacklistHooks::onAPIGetAllowedParams
static onAPIGetAllowedParams(ApiBase &$module, array &$params)
Definition: TitleBlacklist.hooks.php:303
User
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Definition: User.php:50
array
the array() calling protocol came about after MediaWiki 1.4rc1.