Go to the documentation of this file.
131 $this->mOldId = $oldId;
132 $this->mPage = $this->
newPage( $title );
150 return $t ==
null ? null :
new static(
$t );
169 switch (
$title->getNamespace() ) {
213 $this->mRedirectedFrom = $from;
222 return $this->mPage->getTitle();
239 $this->mContentLoaded =
false;
241 $this->mRedirectedFrom =
null; #
Title object if set
242 $this->mRevIdFetched = 0;
243 $this->mRedirectUrl =
false;
244 $this->mRevision =
null;
245 $this->mContentObject =
null;
246 $this->fetchResult =
null;
250 $this->mPage->clear();
271 if ( $this->mPage->getId() === 0 ) {
287 # If this is a MediaWiki:x message, then load the messages
288 # and return the message value for x.
290 $text = $this->
getTitle()->getDefaultMessageText();
291 if ( $text ===
false ) {
297 $message = $this->
getContext()->getUser()->isLoggedIn() ?
'noarticletext' :
'noarticletextanon';
327 if ( is_null( $this->mOldId ) ) {
340 $this->mRedirectUrl =
false;
343 $oldid =
$request->getIntOrNull(
'oldid' );
345 if ( $oldid ===
null ) {
349 if ( $oldid !== 0 ) {
350 # Load the given revision and check whether the page is another one.
351 # In that case, update this instance to reflect the change.
352 if ( $oldid === $this->mPage->getLatest() ) {
353 $this->mRevision = $this->mPage->getRevision();
356 if ( $this->mRevision !==
null ) {
358 if ( $this->mPage->getId() != $this->mRevision->getPage() ) {
359 $function = get_class( $this->mPage ) .
'::newFromID';
360 $this->mPage = $function( $this->mRevision->getPage() );
366 if (
$request->getVal(
'direction' ) ==
'next' ) {
367 $nextid = $this->
getTitle()->getNextRevisionID( $oldid );
370 $this->mRevision =
null;
372 $this->mRedirectUrl = $this->
getTitle()->getFullURL(
'redirect=no' );
374 } elseif (
$request->getVal(
'direction' ) ==
'prev' ) {
375 $previd = $this->
getTitle()->getPreviousRevisionID( $oldid );
378 $this->mRevision =
null;
382 $this->mRevIdFetched = $this->mRevision ? $this->mRevision->getId() : 0;
401 if ( !$this->mContentLoaded ) {
418 if ( $this->fetchResult ) {
419 return $this->mRevision ? $this->mRevision->getRevisionRecord() :
null;
422 $this->mContentLoaded =
true;
423 $this->mContentObject =
null;
428 if ( !$this->mRevision ) {
430 $this->mRevision = $this->mPage->getRevision();
432 if ( !$this->mRevision ) {
433 wfDebug( __METHOD__ .
" failed to find page data for title " .
434 $this->
getTitle()->getPrefixedText() .
"\n" );
444 if ( !$this->mRevision ) {
445 wfDebug( __METHOD__ .
" failed to load revision, rev_id $oldid\n" );
454 $this->mRevIdFetched = $this->mRevision->getId();
458 wfDebug( __METHOD__ .
" failed to retrieve content of revision " .
459 $this->mRevision->getId() .
"\n" );
468 $contentObject = $this->mRevision->getContent(
473 $hookContentObject = $contentObject;
476 $articlePage = $this;
479 'ArticleAfterFetchContentObject',
480 [ &$articlePage, &$hookContentObject ],
484 if ( $hookContentObject !== $contentObject ) {
491 $this->mContentObject = $this->mRevision->getContent(
496 return $this->mRevision->getRevisionRecord();
506 if ( !$this->fetchResult || $this->fetchResult->isOK() ) {
528 $rev->setContent( SlotRecord::MAIN, $override );
533 $this->mContentObject = $override;
542 # If no oldid, this is the current version.
547 return $this->mPage->exists() && $this->mRevision && $this->mRevision->isCurrent();
562 if ( $this->fetchResult->isOK() ) {
576 if ( $this->fetchResult && $this->fetchResult->isOK() ) {
577 return $this->fetchResult->value->getId();
579 return $this->mPage->getLatest();
590 # Get variables from query string
591 # As side effect this will load the revision and update the title
592 # in a revision ID is passed in the request, so this should remain
593 # the first call of this method even if $oldid is used way below.
597 # Another whitelist check in case getOldID() is altering the title
598 $permErrors = $this->
getTitle()->getUserPermissionsErrors(
'read',
$user );
599 if (
count( $permErrors ) ) {
600 wfDebug( __METHOD__ .
": denied on secondary read check\n" );
604 $outputPage = $this->
getContext()->getOutput();
605 # getOldID() may as well want us to redirect somewhere else
606 if ( $this->mRedirectUrl ) {
607 $outputPage->redirect( $this->mRedirectUrl );
608 wfDebug( __METHOD__ .
": redirecting due to oldid\n" );
613 # If we got diff in the query, we want to see a diff page instead of the article.
614 if ( $this->
getContext()->getRequest()->getCheck(
'diff' ) ) {
615 wfDebug( __METHOD__ .
": showing diff page\n" );
621 # Set page title (may be overridden by DISPLAYTITLE)
622 $outputPage->setPageTitle( $this->
getTitle()->getPrefixedText() );
624 $outputPage->setArticleFlag(
true );
625 # Allow frames by default
626 $outputPage->allowClickjacking();
628 $parserCache = MediaWikiServices::getInstance()->getParserCache();
632 # Render printable version, use printable version cache
633 if ( $outputPage->isPrintable() ) {
634 $parserOptions->setIsPrintable(
true );
635 $poOptions[
'enableSectionEditLinks'] =
false;
636 } elseif ( $this->disableSectionEditForRender
639 $poOptions[
'enableSectionEditLinks'] =
false;
642 # Try client and file cache
643 if ( !
$wgDebugToolbar && $oldid === 0 && $this->mPage->checkTouched() ) {
644 # Try to stream the output from file cache
646 wfDebug( __METHOD__ .
": done file cache\n" );
647 # tell wgOut that output is taken care of
648 $outputPage->disable();
649 $this->mPage->doViewUpdates(
$user, $oldid );
655 # Should the parser cache be used?
656 $useParserCache = $this->mPage->shouldCheckParserCache( $parserOptions, $oldid );
657 wfDebug(
'Article::view using parser cache: ' . ( $useParserCache ?
'yes' :
'no' ) .
"\n" );
658 if (
$user->getStubThreshold() ) {
659 MediaWikiServices::getInstance()->getStatsdDataFactory()->increment(
'pcache_miss_stub' );
665 # Iterate through the possible ways of constructing the output text.
666 # Keep going until $outputDone is set, or we run out of things to do.
669 $this->mParserOutput =
false;
671 while ( !$outputDone && ++$pass ) {
675 $articlePage = $this;
676 Hooks::run(
'ArticleViewHeader', [ &$articlePage, &$outputDone, &$useParserCache ] );
679 # Early abort if the page doesn't exist
680 if ( !$this->mPage->exists() ) {
681 wfDebug( __METHOD__ .
": showing missing article\n" );
683 $this->mPage->doViewUpdates(
$user );
687 # Try the parser cache
688 if ( $useParserCache ) {
689 $this->mParserOutput = $parserCache->get( $this->mPage, $parserOptions );
691 if ( $this->mParserOutput !==
false ) {
693 wfDebug( __METHOD__ .
": showing parser cache contents for current rev permalink\n" );
696 wfDebug( __METHOD__ .
": showing parser cache contents\n" );
698 $outputPage->addParserOutput( $this->mParserOutput, $poOptions );
699 # Ensure that UI elements requiring revision ID have
700 # the correct version information.
701 $outputPage->setRevisionId( $this->mPage->getLatest() );
702 # Preload timestamp to avoid a DB hit
703 $cachedTimestamp = $this->mParserOutput->getTimestamp();
704 if ( $cachedTimestamp !==
null ) {
705 $outputPage->setRevisionTimestamp( $cachedTimestamp );
706 $this->mPage->setTimestamp( $cachedTimestamp );
713 # Are we looking at an old revision
715 if ( $oldid && $this->fetchResult->isOK() ) {
719 wfDebug( __METHOD__ .
": cannot view deleted revision\n" );
724 # Ensure that UI elements requiring revision ID have
725 # the correct version information.
727 # Preload timestamp to avoid a DB hit
728 $outputPage->setRevisionTimestamp( $this->mPage->getTimestamp() );
730 # Pages containing custom CSS or JavaScript get special treatment
731 if ( $this->
getTitle()->isSiteConfigPage() || $this->
getTitle()->isUserConfigPage() ) {
732 $dir = $this->
getContext()->getLanguage()->getDir();
735 $outputPage->wrapWikiMsg(
736 "<div id='mw-clearyourcache' lang='$lang' dir='$dir' class='mw-content-$dir'>\n$1\n</div>",
739 } elseif ( !
Hooks::run(
'ArticleRevisionViewCustom', [
749 } elseif ( !
Hooks::run(
'ArticleContentViewCustom',
758 # Run the parse, protected by a pool counter
759 wfDebug( __METHOD__ .
": doing uncached parse\n" );
774 $ok = $poolArticleView->execute();
775 $error = $poolArticleView->getError();
776 $this->mParserOutput = $poolArticleView->getParserOutput() ?:
null;
778 # Don't cache a dirty ParserOutput object
779 if ( $poolArticleView->getIsDirty() ) {
780 $outputPage->setCdnMaxage( 0 );
781 $outputPage->addHTML(
"<!-- parser cache is expired, " .
782 "sending anyway due to pool overload-->\n" );
790 $outputPage->clearHTML();
791 $outputPage->enableClientCache(
false );
792 $outputPage->setRobotPolicy(
'noindex,nofollow' );
794 $errortext = $error->getWikiText(
false,
'view-pool-error' );
797 # Connection or timeout error
801 if ( $this->mParserOutput ) {
802 $outputPage->addParserOutput( $this->mParserOutput, $poOptions );
806 $outputPage->addSubtitle(
"<span id=\"redirectsub\">" .
807 $this->
getContext()->msg(
'redirectpagesub' )->parse() .
"</span>" );
812 # Should be unreachable, but just in case...
825 : $this->mParserOutput ?:
null;
827 # Adjust title for main page & pages with displaytitle
832 # For the main page, overwrite the <title> element with the con-
833 # tents of 'pagetitle-view-mainpage' instead of the default (if
835 # This message always exists because it is in the i18n files
836 if ( $this->
getTitle()->isMainPage() ) {
837 $msg =
wfMessage(
'pagetitle-view-mainpage' )->inContentLanguage();
838 if ( !$msg->isDisabled() ) {
839 $outputPage->setHTMLTitle( $msg->title( $this->getTitle() )->
text() );
843 # Use adaptive TTLs for CDN so delayed/failed purges are noticed less often.
844 # This could use getTouched(), but that could be scary for major template edits.
847 # Check for any __NOINDEX__ tags on the page using $pOutput
849 $outputPage->setIndexPolicy( $policy[
'index'] );
850 $outputPage->setFollowPolicy( $policy[
'follow'] );
853 $this->mPage->doViewUpdates(
$user, $oldid );
855 # Load the postEdit module if the user just saved this revision
856 # See also EditPage::setPostEditCookie
859 $postEdit =
$request->getCookie( $cookieKey );
861 # Clear the cookie. This also prevents caching of the response.
862 $request->response()->clearCookie( $cookieKey );
863 $outputPage->addJsConfigVars(
'wgPostEdit', $postEdit );
864 $outputPage->addModules(
'mediawiki.action.view.postEdit' );
887 # Adjust the title if it was set by displaytitle, -{T|}- or language conversion
889 if ( strval( $titleText ) !==
'' ) {
890 $out->setPageTitle( $titleText );
891 $out->setDisplayTitle( $titleText );
904 $diffOnly =
$request->getBool(
'diffonly',
$user->getOption(
'diffonly' ) );
905 $purge =
$request->getVal(
'action' ) ==
'purge';
913 $msg = $this->
getContext()->msg(
'difference-missing-revision' )
917 $this->
getContext()->getOutput()->addHTML( $msg );
921 $contentHandler =
$rev->getContentHandler();
922 $de = $contentHandler->createDifferenceEngine(
932 $this->mRevIdFetched = $de->getNewid();
933 $de->showDiffPage( $diffOnly );
937 list( $old, $new ) = $de->mapDiffPrevNext( $oldid, $diff );
939 $this->mPage->doViewUpdates(
$user, (
int)$new );
952 $ns = $this->
getTitle()->getNamespace();
954 # Don't index user and user talk pages for blocked users (T13443)
956 $specificTarget =
null;
958 $titleText = $this->
getTitle()->getText();
960 $vagueTarget = $titleText;
962 $specificTarget = $titleText;
966 'index' =>
'noindex',
967 'follow' =>
'nofollow'
972 if ( $this->mPage->getId() === 0 || $this->
getOldID() ) {
973 # Non-articles (special pages etc), and old revisions
975 'index' =>
'noindex',
976 'follow' =>
'nofollow'
978 } elseif ( $this->
getContext()->getOutput()->isPrintable() ) {
979 # Discourage indexing of printable versions, but encourage following
981 'index' =>
'noindex',
984 } elseif ( $this->
getContext()->getRequest()->getInt(
'curid' ) ) {
985 # For ?curid=x urls, disallow indexing
987 'index' =>
'noindex',
992 # Otherwise, construct the policy based on the various config variables.
996 # Honour customised robot policies for this namespace
997 $policy = array_merge(
1002 if ( $this->
getTitle()->canUseNoindex() && is_object( $pOutput ) && $pOutput->getIndexPolicy() ) {
1003 # __INDEX__ and __NOINDEX__ magic words, if allowed. Incorporates
1004 # a final sanity check that we have really got the parser output.
1005 $policy = array_merge(
1007 [
'index' => $pOutput->getIndexPolicy() ]
1012 # (T16900) site config can override user-defined __INDEX__ or __NOINDEX__
1013 $policy = array_merge(
1030 if ( is_array( $policy ) ) {
1032 } elseif ( !$policy ) {
1036 $policy = explode(
',', $policy );
1037 $policy = array_map(
'trim', $policy );
1040 foreach ( $policy
as $var ) {
1041 if ( in_array( $var, [
'index',
'noindex' ] ) ) {
1042 $arr[
'index'] = $var;
1043 } elseif ( in_array( $var, [
'follow',
'nofollow' ] ) ) {
1044 $arr[
'follow'] = $var;
1062 $outputPage =
$context->getOutput();
1064 $rdfrom =
$request->getVal(
'rdfrom' );
1068 unset(
$query[
'rdfrom'] );
1069 unset(
$query[
'title'] );
1072 $query[
'redirect'] =
'no';
1076 if ( isset( $this->mRedirectedFrom ) ) {
1078 $articlePage = $this;
1082 if (
Hooks::run(
'ArticleViewRedirect', [ &$articlePage ] ) ) {
1084 $this->mRedirectedFrom,
1087 [
'redirect' =>
'no' ]
1090 $outputPage->addSubtitle(
"<span class=\"mw-redirectedfrom\">" .
1091 $context->msg(
'redirectedfrom' )->rawParams( $redir )->parse()
1096 $outputPage->addJsConfigVars( [
1097 'wgInternalRedirectTargetUrl' => $redirectTargetUrl,
1099 $outputPage->addModules(
'mediawiki.action.view.redirect' );
1102 $outputPage->setCanonicalUrl( $this->
getTitle()->getCanonicalURL() );
1105 $outputPage->setRedirectedFrom( $this->mRedirectedFrom );
1109 } elseif ( $rdfrom ) {
1114 $outputPage->addSubtitle(
"<span class=\"mw-redirectedfrom\">" .
1115 $context->msg(
'redirectedfrom' )->rawParams( $redir )->parse()
1119 $outputPage->addJsConfigVars( [
1120 'wgInternalRedirectTargetUrl' => $redirectTargetUrl,
1122 $outputPage->addModules(
'mediawiki.action.view.redirect' );
1136 if ( $this->
getTitle()->isTalkPage() ) {
1137 if ( !
wfMessage(
'talkpageheader' )->isDisabled() ) {
1138 $this->
getContext()->getOutput()->wrapWikiMsg(
1139 "<div class=\"mw-talkpageheader\">\n$1\n</div>",
1140 [
'talkpageheader' ]
1150 # check if we're displaying a [[User talk:x.x.x.x]] anonymous talk page
1154 $this->
getContext()->getOutput()->addWikiMsg(
'anontalkpagetext' );
1160 Hooks::run(
'ArticleViewFooter', [ $this, $patrolFooterShown ] );
1176 if ( !
Hooks::run(
'ArticleShowPatrolFooter', [ $this ] ) ) {
1180 $outputPage = $this->
getContext()->getOutput();
1193 if ( $this->mRevision
1202 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
1203 $key =
$cache->makeKey(
'unpatrollable-page',
$title->getArticleID() );
1204 if (
$cache->get( $key ) ) {
1209 $oldestRevisionTimestamp =
$dbr->selectField(
1211 'MIN( rev_timestamp )',
1212 [
'rev_page' =>
$title->getArticleID() ],
1221 $recentPageCreation =
false;
1222 if ( $oldestRevisionTimestamp
1226 $recentPageCreation =
true;
1230 'rc_timestamp' => $oldestRevisionTimestamp,
1231 'rc_namespace' =>
$title->getNamespace(),
1232 'rc_cur_id' =>
$title->getArticleID()
1238 $markPatrolledMsg =
wfMessage(
'markaspatrolledtext' );
1246 $recentFileUpload =
false;
1250 $newestUploadTimestamp =
$dbr->selectField(
1252 'MAX( img_timestamp )',
1253 [
'img_name' =>
$title->getDBkey() ],
1256 if ( $newestUploadTimestamp
1260 $recentFileUpload =
true;
1264 'rc_log_type' =>
'upload',
1265 'rc_timestamp' => $newestUploadTimestamp,
1267 'rc_cur_id' =>
$title->getArticleID()
1273 $markPatrolledMsg =
wfMessage(
'markaspatrolledtext-file' );
1278 if ( !$recentPageCreation && !$recentFileUpload ) {
1283 $cache->set( $key,
'1' );
1295 if ( $rc->getAttribute(
'rc_patrolled' ) ) {
1300 $cache->set( $key,
'1' );
1305 if ( $rc->getPerformer()->equals(
$user ) ) {
1311 $outputPage->preventClickjacking();
1312 if (
$user->isAllowed(
'writeapi' ) ) {
1313 $outputPage->addModules(
'mediawiki.page.patrol.ajax' );
1318 $markPatrolledMsg->escaped(),
1321 'action' =>
'markpatrolled',
1322 'rcid' => $rc->getAttribute(
'rc_id' ),
1326 $outputPage->addHTML(
1327 "<div class='patrollink' data-mw='interface'>" .
1328 wfMessage(
'markaspatrolledlink' )->rawParams(
$link )->escaped() .
1342 $cache = MediaWikiServices::getInstance()->getMainWANObjectCache();
1343 $cache->delete(
$cache->makeKey(
'unpatrollable-page', $articleID ) );
1353 $outputPage = $this->
getContext()->getOutput();
1355 $validUserPage =
false;
1359 # Show info in user (talk) namespace. Does the user exist? Is he blocked?
1363 $rootPart = explode(
'/',
$title->getText() )[0];
1369 $outputPage->wrapWikiMsg(
"<div class=\"mw-userpage-userdoesnotexist error\">\n\$1\n</div>",
1372 # Show log extract if the user is currently blocked
1380 'showIfEmpty' =>
false,
1382 'blocked-notice-logextract',
1383 $user->getName() # Support GENDER
in notice
1387 $validUserPage = !
$title->isSubpage();
1389 $validUserPage = !
$title->isSubpage();
1393 Hooks::run(
'ShowMissingArticle', [ $this ] );
1395 # Show delete and move logs if there were any such events.
1396 # The logging query can DOS the site when bots/crawlers cause 404 floods,
1397 # so be careful showing this. 404 pages must be cheap as they are hard to cache.
1398 $cache = MediaWikiServices::getInstance()->getMainObjectStash();
1399 $key =
$cache->makeKey(
'page-recent-delete', md5(
$title->getPrefixedText() ) );
1400 $loggedIn = $this->
getContext()->getUser()->isLoggedIn();
1401 $sessionExists = $this->
getContext()->getRequest()->getSession()->isPersistent();
1402 if ( $loggedIn ||
$cache->get( $key ) || $sessionExists ) {
1403 $logTypes = [
'delete',
'move',
'protect' ];
1407 $conds = [
'log_action != ' .
$dbr->addQuotes(
'revision' ) ];
1409 Hooks::run(
'Article::MissingArticleConditions', [ &$conds, $logTypes ] );
1418 'showIfEmpty' =>
false,
1419 'msgKey' => [ $loggedIn || $sessionExists
1420 ?
'moveddeleted-notice'
1421 :
'moveddeleted-notice-recent'
1427 if ( !$this->mPage->hasViewableContent() &&
$wgSend404Code && !$validUserPage ) {
1430 $this->
getContext()->getRequest()->response()->statusHeader( 404 );
1435 $outputPage->setIndexPolicy( $policy[
'index'] );
1436 $outputPage->setFollowPolicy( $policy[
'follow'] );
1438 $hookResult =
Hooks::run(
'BeforeDisplayNoArticleText', [ $this ] );
1440 if ( !$hookResult ) {
1444 # Show error message
1452 $text =
wfMessage(
'missing-revision', $oldid )->plain();
1453 } elseif (
$title->quickUserCan(
'create', $this->getContext()->getUser() )
1454 &&
$title->quickUserCan(
'edit', $this->getContext()->getUser() )
1456 $message = $this->
getContext()->getUser()->isLoggedIn() ?
'noarticletext' :
'noarticletextanon';
1459 $text =
wfMessage(
'noarticletext-nopermission' )->plain();
1462 $dir = $this->
getContext()->getLanguage()->getDir();
1465 'class' =>
"noarticletext mw-content-$dir",
1468 ] ) .
"\n$text\n</div>" );
1484 $outputPage = $this->
getContext()->getOutput();
1488 $outputPage->wrapWikiMsg(
"<div class='mw-warning plainlinks'>\n$1\n</div>\n",
1489 'rev-deleted-text-permission' );
1493 } elseif ( $this->
getContext()->getRequest()->getInt(
'unhide' ) != 1 ) {
1494 # Give explanation and add a link to view the revision...
1495 $oldid = intval( $this->
getOldID() );
1496 $link = $this->
getTitle()->getFullURL(
"oldid={$oldid}&unhide=1" );
1498 'rev-suppressed-text-unhide' :
'rev-deleted-text-unhide';
1499 $outputPage->wrapWikiMsg(
"<div class='mw-warning plainlinks'>\n$1\n</div>\n",
1506 'rev-suppressed-text-view' :
'rev-deleted-text-view';
1507 $outputPage->wrapWikiMsg(
"<div class='mw-warning plainlinks'>\n$1\n</div>\n", $msg );
1523 $articlePage = $this;
1525 if ( !
Hooks::run(
'DisplayOldSubtitle', [ &$articlePage, &$oldid ] ) ) {
1532 # Cascade unhide param in links for easy deletion browsing
1535 $extraParams[
'unhide'] = 1;
1538 if ( $this->mRevision && $this->mRevision->getId() === $oldid ) {
1544 $timestamp = $revision->getTimestamp();
1546 $current = ( $oldid == $this->mPage->getLatest() );
1547 $language =
$context->getLanguage();
1550 $td = $language->userTimeAndDate( $timestamp,
$user );
1551 $tddate = $language->userDate( $timestamp,
$user );
1552 $tdtime = $language->userTime( $timestamp,
$user );
1554 # Show user links if allowed to see them. If hidden, then show them only if requested...
1557 $infomsg = $current && !
$context->msg(
'revision-info-current' )->isDisabled()
1558 ?
'revision-info-current'
1561 $outputPage =
$context->getOutput();
1562 $revisionInfo =
"<div id=\"mw-{$infomsg}\">" .
1564 ->rawParams( $userlinks )
1565 ->params( $revision->getId(), $tddate, $tdtime, $revision->getUserText() )
1571 ?
$context->msg(
'currentrevisionlink' )->escaped()
1574 $context->msg(
'currentrevisionlink' )->escaped(),
1579 ?
$context->msg(
'diff' )->escaped()
1582 $context->msg(
'diff' )->escaped(),
1589 $prev = $this->
getTitle()->getPreviousRevisionID( $oldid );
1593 $context->msg(
'previousrevision' )->escaped(),
1596 'direction' =>
'prev',
1600 :
$context->msg(
'previousrevision' )->escaped();
1604 $context->msg(
'diff' )->escaped(),
1611 :
$context->msg(
'diff' )->escaped();
1612 $nextlink = $current
1613 ?
$context->msg(
'nextrevision' )->escaped()
1616 $context->msg(
'nextrevision' )->escaped(),
1619 'direction' =>
'next',
1623 $nextdiff = $current
1624 ?
$context->msg(
'diff' )->escaped()
1627 $context->msg(
'diff' )->escaped(),
1636 if ( $cdel !==
'' ) {
1641 $outputPage->addSubtitle(
"<div class=\"mw-revision\">" . $revisionInfo .
1642 "<div id=\"mw-revision-nav\">" . $cdel .
1643 $context->msg(
'revision-nav' )->rawParams(
1644 $prevdiff, $prevlink, $lnk, $curdiff, $nextlink, $nextdiff
1645 )->escaped() .
"</div></div>" );
1661 public function viewRedirect( $target, $appendSubtitle =
true, $forceKnown =
false ) {
1664 if ( $appendSubtitle ) {
1667 $out->addModuleStyles(
'mediawiki.action.view.redirectPage' );
1668 return static::getRedirectHeaderHtml(
$lang, $target, $forceKnown );
1684 if ( !is_array( $target ) ) {
1685 $target = [ $target ];
1688 $html =
'<ul class="redirectText">';
1693 htmlspecialchars(
$title->getFullText() ),
1696 $title->isRedirect() ? [
'redirect' =>
'no' ] : [],
1697 ( $forceKnown ? [
'known',
'noclasses' ] : [] )
1702 $redirectToText =
wfMessage(
'redirectto' )->inLanguage(
$lang )->escaped();
1704 return '<div class="redirectMsg">' .
1705 '<p>' . $redirectToText .
'</p>' .
1720 'namespace-' . $this->
getTitle()->getNamespace() .
'-helppage'
1724 if ( !$msg->isDisabled() ) {
1726 $out->addHelpLink( $helpUrl,
true );
1728 $out->addHelpLink( $to, $overrideBaseUrl );
1736 $this->
getContext()->getRequest()->response()->header(
'X-Robots-Tag: noindex' );
1737 $this->
getContext()->getOutput()->setArticleBodyOnly(
true );
1738 $this->disableSectionEditForRender =
true;
1760 public function delete() {
1761 # This code desperately needs to be totally rewritten
1769 $permissionErrors =
$title->getUserPermissionsErrors(
'delete',
$user );
1770 if (
count( $permissionErrors ) ) {
1774 # Read-only check...
1779 # Better double-check that it hasn't been deleted yet!
1780 $this->mPage->loadPageData(
1781 $request->wasPosted() ? WikiPage::READ_LATEST : WikiPage::READ_NORMAL
1783 if ( !$this->mPage->exists() ) {
1784 $deleteLogPage =
new LogPage(
'delete' );
1785 $outputPage =
$context->getOutput();
1786 $outputPage->setPageTitle(
$context->msg(
'cannotdelete-title',
$title->getPrefixedText() ) );
1787 $outputPage->wrapWikiMsg(
"<div class=\"error mw-error-cannotdelete\">\n$1\n</div>",
1790 $outputPage->addHTML(
1791 Xml::element(
'h2',
null, $deleteLogPage->getName()->text() )
1802 $deleteReasonList =
$request->getText(
'wpDeleteReasonList',
'other' );
1803 $deleteReason =
$request->getText(
'wpReason' );
1805 if ( $deleteReasonList ==
'other' ) {
1806 $reason = $deleteReason;
1807 } elseif ( $deleteReason !=
'' ) {
1809 $colonseparator =
wfMessage(
'colon-separator' )->inContentLanguage()->text();
1810 $reason = $deleteReasonList . $colonseparator . $deleteReason;
1812 $reason = $deleteReasonList;
1816 [
'delete', $this->
getTitle()->getPrefixedText() ] )
1818 # Flag to hide all contents of the archived revisions
1819 $suppress =
$request->getCheck(
'wpSuppress' ) &&
$user->isAllowed(
'suppressrevision' );
1821 $this->
doDelete( $reason, $suppress );
1829 $hasHistory =
false;
1833 }
catch ( Exception
$e ) {
1834 # if a page is horribly broken, we still want to be able to
1835 # delete it. So be lenient about errors here.
1836 wfDebug(
"Error while building auto delete summary: $e" );
1842 if ( $hasHistory ) {
1851 $revisions = $edits = (int)
$dbr->selectField(
1854 [
'rev_page' =>
$title->getArticleID() ],
1860 '<strong class="mw-delete-warning-revisions">' .
1861 $context->msg(
'historywarning' )->numParams( $revisions )->parse() .
1863 $context->msg(
'history' )->escaped(),
1865 [
'action' =>
'history' ] ) .
1869 if (
$title->isBigDeletion() ) {
1871 $context->getOutput()->wrapWikiMsg(
"<div class='error'>\n$1\n</div>\n",
1873 'delete-warning-toobig',
1889 wfDebug(
"Article::confirmDelete\n" );
1893 $outputPage = $ctx->getOutput();
1894 $outputPage->setPageTitle(
wfMessage(
'delete-confirm',
$title->getPrefixedText() ) );
1895 $outputPage->addBacklinkSubtitle(
$title );
1896 $outputPage->setRobotPolicy(
'noindex,nofollow' );
1897 $outputPage->addModules(
'mediawiki.action.delete' );
1899 $backlinkCache =
$title->getBacklinkCache();
1900 if ( $backlinkCache->hasLinks(
'pagelinks' ) || $backlinkCache->hasLinks(
'templatelinks' ) ) {
1901 $outputPage->wrapWikiMsg(
"<div class='mw-warning plainlinks'>\n$1\n</div>\n",
1902 'deleting-backlinks-warning' );
1905 $subpageQueryLimit = 51;
1906 $subpages =
$title->getSubpages( $subpageQueryLimit );
1907 $subpageCount =
count( $subpages );
1908 if ( $subpageCount > 0 ) {
1909 $outputPage->wrapWikiMsg(
"<div class='mw-warning plainlinks'>\n$1\n</div>\n",
1910 [
'deleting-subpages-warning', Message::numParam( $subpageCount ) ] );
1912 $outputPage->addWikiMsg(
'confirmdeletetext' );
1914 Hooks::run(
'ArticleConfirmDelete', [ $this, $outputPage, &$reason ] );
1917 $checkWatch =
$user->getBoolOption(
'watchdeletion' ) ||
$user->isWatched(
$title );
1919 $outputPage->enableOOUI();
1922 $ctx->msg(
'deletereason-dropdown' )->inContentLanguage()->text(),
1923 [
'other' => $ctx->msg(
'deletereasonotherlist' )->inContentLanguage()->text() ]
1927 $fields[] =
new OOUI\FieldLayout(
1928 new OOUI\DropdownInputWidget( [
1929 'name' =>
'wpDeleteReasonList',
1930 'inputId' =>
'wpDeleteReasonList',
1932 'infusable' =>
true,
1937 'label' => $ctx->msg(
'deletecomment' )->text(),
1946 $oldCommentSchema = $conf->get(
'CommentTableSchemaMigrationStage' ) ===
MIGRATION_OLD;
1947 $fields[] =
new OOUI\FieldLayout(
1948 new OOUI\TextInputWidget( [
1949 'name' =>
'wpReason',
1950 'inputId' =>
'wpReason',
1953 'infusable' =>
true,
1955 'autofocus' =>
true,
1958 'label' => $ctx->msg(
'deleteotherreason' )->text(),
1963 if (
$user->isLoggedIn() ) {
1964 $fields[] =
new OOUI\FieldLayout(
1965 new OOUI\CheckboxInputWidget( [
1966 'name' =>
'wpWatch',
1967 'inputId' =>
'wpWatch',
1969 'selected' => $checkWatch,
1972 'label' => $ctx->msg(
'watchthis' )->text(),
1973 'align' =>
'inline',
1974 'infusable' =>
true,
1979 if (
$user->isAllowed(
'suppressrevision' ) ) {
1980 $fields[] =
new OOUI\FieldLayout(
1981 new OOUI\CheckboxInputWidget( [
1982 'name' =>
'wpSuppress',
1983 'inputId' =>
'wpSuppress',
1987 'label' => $ctx->msg(
'revdelete-suppress' )->text(),
1988 'align' =>
'inline',
1989 'infusable' =>
true,
1994 $fields[] =
new OOUI\FieldLayout(
1995 new OOUI\ButtonInputWidget( [
1996 'name' =>
'wpConfirmB',
1997 'inputId' =>
'wpConfirmB',
1999 'value' => $ctx->msg(
'deletepage' )->text(),
2000 'label' => $ctx->msg(
'deletepage' )->text(),
2001 'flags' => [
'primary',
'destructive' ],
2009 $fieldset =
new OOUI\FieldsetLayout( [
2010 'label' => $ctx->msg(
'delete-legend' )->text(),
2011 'id' =>
'mw-delete-table',
2015 $form =
new OOUI\FormLayout( [
2017 'action' =>
$title->getLocalURL(
'action=delete' ),
2018 'id' =>
'deleteconfirm',
2020 $form->appendContent(
2022 new OOUI\HtmlSnippet(
2027 $outputPage->addHTML(
2028 new OOUI\PanelLayout( [
2029 'classes' => [
'deletepage-wrapper' ],
2030 'expanded' =>
false,
2037 if (
$user->isAllowed(
'editinterface' ) ) {
2039 $ctx->msg(
'deletereason-dropdown' )->inContentLanguage()->getTitle(),
2040 wfMessage(
'delete-edit-reasonlist' )->escaped(),
2042 [
'action' =>
'edit' ]
2044 $outputPage->addHTML(
'<p class="mw-delete-editreasons">' .
$link .
'</p>' );
2047 $deleteLogPage =
new LogPage(
'delete' );
2048 $outputPage->addHTML(
Xml::element(
'h2',
null, $deleteLogPage->getName()->text() ) );
2060 public function doDelete( $reason, $suppress =
false, $immediate =
false ) {
2063 $outputPage =
$context->getOutput();
2065 $status = $this->mPage->doDeleteArticleReal( $reason, $suppress, 0,
true, $error,
$user,
2066 [],
'delete', $immediate );
2069 $deleted = $this->
getTitle()->getPrefixedText();
2071 $outputPage->setPageTitle(
wfMessage(
'actioncomplete' ) );
2072 $outputPage->setRobotPolicy(
'noindex,nofollow' );
2075 $loglink =
'[[Special:Log/delete|' .
wfMessage(
'deletionlog' )->text() .
']]';
2076 $outputPage->addWikiMsg(
'deletedtext',
wfEscapeWikiText( $deleted ), $loglink );
2079 $outputPage->addWikiMsg(
'delete-scheduled',
wfEscapeWikiText( $deleted ) );
2082 $outputPage->returnToMain(
false );
2084 $outputPage->setPageTitle(
2086 $this->
getTitle()->getPrefixedText() )
2089 if ( $error ==
'' ) {
2090 $outputPage->addWikiText(
2091 "<div class=\"error mw-error-cannotdelete\">\n" .
$status->getWikiText() .
"\n</div>"
2093 $deleteLogPage =
new LogPage(
'delete' );
2094 $outputPage->addHTML(
Xml::element(
'h2',
null, $deleteLogPage->getName()->text() ) );
2102 $outputPage->addHTML( $error );
2117 static $called =
false;
2120 wfDebug(
"Article::tryFileCache(): called twice!?\n" );
2127 if (
$cache->isCacheGood( $this->mPage->getTouched() ) ) {
2128 wfDebug(
"Article::tryFileCache(): about to load file\n" );
2132 wfDebug(
"Article::tryFileCache(): starting buffer\n" );
2133 ob_start( [ &
$cache,
'saveToFileCache' ] );
2136 wfDebug(
"Article::tryFileCache(): not cacheable\n" );
2151 $cacheable = $this->mPage->getId()
2152 && !$this->mRedirectedFrom && !$this->
getTitle()->isRedirect();
2156 $articlePage = $this;
2157 $cacheable =
Hooks::run(
'IsFileCacheable', [ &$articlePage ] );
2180 if (
$user ===
null ) {
2183 $parserOptions = $this->mPage->makeParserOptions(
$user );
2186 return $this->mPage->getParserOutput( $parserOptions, $oldid );
2196 if ( $this->mParserOptions ) {
2197 throw new MWException(
"can't change parser options after they have already been set" );
2201 $this->mParserOptions = clone
$options;
2209 if ( !$this->mParserOptions ) {
2210 $this->mParserOptions = $this->mPage->makeParserOptions( $this->
getContext() );
2236 wfDebug( __METHOD__ .
" called and \$mContext is null. " .
2237 "Return RequestContext::getMain(); for sanity\n" );
2250 if ( property_exists( $this->mPage,
$fname ) ) {
2251 # wfWarn( "Access to raw $fname field " . __CLASS__ );
2252 return $this->mPage->$fname;
2254 trigger_error(
'Inaccessible property via __get(): ' .
$fname, E_USER_NOTICE );
2265 if ( property_exists( $this->mPage,
$fname ) ) {
2266 # wfWarn( "Access to raw $fname field of " . __CLASS__ );
2267 $this->mPage->$fname = $fvalue;
2269 } elseif ( !in_array(
$fname, [
'mContext',
'mPage' ] ) ) {
2270 $this->mPage->$fname = $fvalue;
2272 trigger_error(
'Inaccessible property via __set(): ' .
$fname, E_USER_NOTICE );
2281 return $this->mPage->checkFlags( $flags );
2289 return $this->mPage->checkTouched();
2297 $this->mPage->clearPreparedEdit();
2305 $reason, $suppress =
false, $u1 =
null, $u2 =
null, &$error =
'',
User $user =
null,
2306 $tags = [], $immediate =
false
2308 return $this->mPage->doDeleteArticleReal(
2309 $reason, $suppress, $u1, $u2, $error,
$user, $tags,
'delete', $immediate
2323 $this->mPage->doDeleteUpdates( $id,
$content, $revision,
$user );
2335 return $this->mPage->doEditContent(
$content, $summary, $flags, $originalRevId,
2336 $user, $serialFormat
2345 return $this->mPage->doEditUpdates( $revision,
$user,
$options );
2355 return $this->mPage->doPurge();
2363 $this->mPage->doViewUpdates(
$user, $oldid );
2371 return $this->mPage->exists();
2379 return $this->mPage->followRedirect();
2387 return $this->mPage->getActionOverrides();
2395 return $this->mPage->getAutoDeleteReason( $hasHistory );
2403 return $this->mPage->getCategories();
2411 return $this->mPage->getComment( $audience,
$user );
2419 return $this->mPage->getContentHandler();
2427 return $this->mPage->getContentModel();
2435 return $this->mPage->getContributors();
2443 return $this->mPage->getCreator( $audience,
$user );
2451 return $this->mPage->getDeletionUpdates(
$content );
2459 return $this->mPage->getHiddenCategories();
2467 return $this->mPage->getId();
2475 return $this->mPage->getLatest();
2483 return $this->mPage->getLinksTimestamp();
2491 return $this->mPage->getMinorEdit();
2499 return $this->mPage->getOldestRevision();
2507 return $this->mPage->getRedirectTarget();
2515 return $this->mPage->getRedirectURL( $rt );
2523 return $this->mPage->getRevision();
2531 return $this->mPage->getTimestamp();
2539 return $this->mPage->getTouched();
2547 return $this->mPage->getUndoContent( $undo, $undoafter );
2555 return $this->mPage->getUser( $audience,
$user );
2563 return $this->mPage->getUserText( $audience,
$user );
2571 return $this->mPage->hasViewableContent();
2579 return $this->mPage->insertOn( $dbw, $pageId );
2587 array $expiry, $cascade, $reason,
$user =
null
2589 return $this->mPage->insertProtectNullRevision( $revCommentMsg, $limit,
2590 $expiry, $cascade, $reason,
$user
2599 return $this->mPage->insertRedirect();
2607 return $this->mPage->insertRedirectEntry( $rt, $oldLatest );
2615 return $this->mPage->isCountable( $editInfo );
2623 return $this->mPage->isRedirect();
2631 return $this->mPage->loadFromRow( $data, $from );
2639 $this->mPage->loadPageData( $from );
2647 return $this->mPage->lockAndGetLatest();
2655 return $this->mPage->makeParserOptions(
$context );
2663 return $this->mPage->pageDataFromId(
$dbr, $id,
$options );
2680 $serialFormat =
null, $useCache =
true
2682 return $this->mPage->prepareContentForEdit(
2684 $serialFormat, $useCache
2693 return $this->mPage->protectDescription( $limit, $expiry );
2701 return $this->mPage->protectDescriptionLog( $limit, $expiry );
2709 $sectionTitle =
'', $baseRevId =
null
2711 return $this->mPage->replaceSectionAtRev( $sectionId, $sectionContent,
2712 $sectionTitle, $baseRevId
2721 $sectionId,
Content $sectionContent, $sectionTitle =
'', $edittime =
null
2723 return $this->mPage->replaceSectionContent(
2724 $sectionId, $sectionContent, $sectionTitle, $edittime
2733 return $this->mPage->setTimestamp( $ts );
2741 return $this->mPage->shouldCheckParserCache( $parserOptions, $oldId );
2749 return $this->mPage->supportsSections();
2757 return $this->mPage->triggerOpportunisticLinksUpdate( $parserOutput );
2765 return $this->mPage->updateCategoryCounts( $added, $deleted, $id );
2773 return $this->mPage->updateIfNewerOn( $dbw, $revision );
2781 return $this->mPage->updateRedirectOn( $dbw, $redirectTitle, $lastRevIsRedirect );
2789 $lastRevIsRedirect =
null
2791 return $this->mPage->updateRevisionOn( $dbw, $revision, $lastRevision,
2807 return $this->mPage->doUpdateRestrictions( $limit, $expiry, $cascade, $reason,
$user );
2818 &$cascade = 0, $expiry = []
2820 return $this->mPage->doUpdateRestrictions(
2841 $reason, $suppress =
false, $u1 =
null, $u2 =
null, &$error =
'', $immediate =
false
2843 return $this->mPage->doDeleteArticle( $reason, $suppress, $u1, $u2, $error,
2858 return $this->mPage->doRollback( $fromP, $summary, $token, $bot, $resultDetails,
$user );
2870 $guser = is_null( $guser ) ? $this->
getContext()->getUser() : $guser;
2871 return $this->mPage->commitRollback( $fromP, $summary, $bot, $resultDetails, $guser );
2879 $title = $this->mPage->getTitle();
Show an error when the wiki is locked/read-only and the user tries to do something that requires writ...
$wgSend404Code
Some web hosts attempt to rewrite all responses with a 404 (not found) status code,...
showMissingArticle()
Show the error text for a missing article.
checkFlags( $flags)
Call to WikiPage function for backwards compatibility.
Status::newGood()` to allow deletion, and then `return false` from the hook function. Ensure you consume the 'ChangeTagAfterDelete' hook to carry out custom deletion actions. $tag:name of the tag $user:user initiating the action & $status:Status object. See above. 'ChangeTagsListActive':Allows you to nominate which of the tags your extension uses are in active use. & $tags:list of all active tags. Append to this array. 'ChangeTagsAfterUpdateTags':Called after tags have been updated with the ChangeTags::updateTags function. Params:$addedTags:tags effectively added in the update $removedTags:tags effectively removed in the update $prevTags:tags that were present prior to the update $rc_id:recentchanges table id $rev_id:revision table id $log_id:logging table id $params:tag params $rc:RecentChange being tagged when the tagging accompanies the action, or null $user:User who performed the tagging when the tagging is subsequent to the action, or null 'ChangeTagsAllowedAdd':Called when checking if a user can add tags to a change. & $allowedTags:List of all the tags the user is allowed to add. Any tags the user wants to add( $addTags) that are not in this array will cause it to fail. You may add or remove tags to this array as required. $addTags:List of tags user intends to add. $user:User who is adding the tags. 'ChangeUserGroups':Called before user groups are changed. $performer:The User who will perform the change $user:The User whose groups will be changed & $add:The groups that will be added & $remove:The groups that will be removed 'Collation::factory':Called if $wgCategoryCollation is an unknown collation. $collationName:Name of the collation in question & $collationObject:Null. Replace with a subclass of the Collation class that implements the collation given in $collationName. 'ConfirmEmailComplete':Called after a user 's email has been confirmed successfully. $user:user(object) whose email is being confirmed 'ContentAlterParserOutput':Modify parser output for a given content object. Called by Content::getParserOutput after parsing has finished. Can be used for changes that depend on the result of the parsing but have to be done before LinksUpdate is called(such as adding tracking categories based on the rendered HTML). $content:The Content to render $title:Title of the page, as context $parserOutput:ParserOutput to manipulate 'ContentGetParserOutput':Customize parser output for a given content object, called by AbstractContent::getParserOutput. May be used to override the normal model-specific rendering of page content. $content:The Content to render $title:Title of the page, as context $revId:The revision ID, as context $options:ParserOptions for rendering. To avoid confusing the parser cache, the output can only depend on parameters provided to this hook function, not on global state. $generateHtml:boolean, indicating whether full HTML should be generated. If false, generation of HTML may be skipped, but other information should still be present in the ParserOutput object. & $output:ParserOutput, to manipulate or replace 'ContentHandlerDefaultModelFor':Called when the default content model is determined for a given title. May be used to assign a different model for that title. $title:the Title in question & $model:the model name. Use with CONTENT_MODEL_XXX constants. 'ContentHandlerForModelID':Called when a ContentHandler is requested for a given content model name, but no entry for that model exists in $wgContentHandlers. Note:if your extension implements additional models via this hook, please use GetContentModels hook to make them known to core. $modeName:the requested content model name & $handler:set this to a ContentHandler object, if desired. 'ContentModelCanBeUsedOn':Called to determine whether that content model can be used on a given page. This is especially useful to prevent some content models to be used in some special location. $contentModel:ID of the content model in question $title:the Title in question. & $ok:Output parameter, whether it is OK to use $contentModel on $title. Handler functions that modify $ok should generally return false to prevent further hooks from further modifying $ok. 'ContribsPager::getQueryInfo':Before the contributions query is about to run & $pager:Pager object for contributions & $queryInfo:The query for the contribs Pager 'ContribsPager::reallyDoQuery':Called before really executing the query for My Contributions & $data:an array of results of all contribs queries $pager:The ContribsPager object hooked into $offset:Index offset, inclusive $limit:Exact query limit $descending:Query direction, false for ascending, true for descending 'ContributionsLineEnding':Called before a contributions HTML line is finished $page:SpecialPage object for contributions & $ret:the HTML line $row:the DB row for this line & $classes:the classes to add to the surrounding< li > & $attribs:associative array of other HTML attributes for the< li > element. Currently only data attributes reserved to MediaWiki are allowed(see Sanitizer::isReservedDataAttribute). 'ContributionsToolLinks':Change tool links above Special:Contributions $id:User identifier $title:User page title & $tools:Array of tool links $specialPage:SpecialPage instance for context and services. Can be either SpecialContributions or DeletedContributionsPage. Extensions should type hint against a generic SpecialPage though. 'ConvertContent':Called by AbstractContent::convert when a conversion to another content model is requested. Handler functions that modify $result should generally return false to disable further attempts at conversion. $content:The Content object to be converted. $toModel:The ID of the content model to convert to. $lossy:boolean indicating whether lossy conversion is allowed. & $result:Output parameter, in case the handler function wants to provide a converted Content object. Note that $result->getContentModel() must return $toModel. 'ContentSecurityPolicyDefaultSource':Modify the allowed CSP load sources. This affects all directives except for the script directive. If you want to add a script source, see ContentSecurityPolicyScriptSource hook. & $defaultSrc:Array of Content-Security-Policy allowed sources $policyConfig:Current configuration for the Content-Security-Policy header $mode:ContentSecurityPolicy::REPORT_ONLY_MODE or ContentSecurityPolicy::FULL_MODE depending on type of header 'ContentSecurityPolicyDirectives':Modify the content security policy directives. Use this only if ContentSecurityPolicyDefaultSource and ContentSecurityPolicyScriptSource do not meet your needs. & $directives:Array of CSP directives $policyConfig:Current configuration for the CSP header $mode:ContentSecurityPolicy::REPORT_ONLY_MODE or ContentSecurityPolicy::FULL_MODE depending on type of header 'ContentSecurityPolicyScriptSource':Modify the allowed CSP script sources. Note that you also have to use ContentSecurityPolicyDefaultSource if you want non-script sources to be loaded from whatever you add. & $scriptSrc:Array of CSP directives $policyConfig:Current configuration for the CSP header $mode:ContentSecurityPolicy::REPORT_ONLY_MODE or ContentSecurityPolicy::FULL_MODE depending on type of header 'CustomEditor':When invoking the page editor Return true to allow the normal editor to be used, or false if implementing a custom editor, e.g. for a special namespace, etc. $article:Article being edited $user:User performing the edit 'DatabaseOraclePostInit':Called after initialising an Oracle database $db:the DatabaseOracle object 'DeletedContribsPager::reallyDoQuery':Called before really executing the query for Special:DeletedContributions Similar to ContribsPager::reallyDoQuery & $data:an array of results of all contribs queries $pager:The DeletedContribsPager object hooked into $offset:Index offset, inclusive $limit:Exact query limit $descending:Query direction, false for ascending, true for descending 'DeletedContributionsLineEnding':Called before a DeletedContributions HTML line is finished. Similar to ContributionsLineEnding $page:SpecialPage object for DeletedContributions & $ret:the HTML line $row:the DB row for this line & $classes:the classes to add to the surrounding< li > & $attribs:associative array of other HTML attributes for the< li > element. Currently only data attributes reserved to MediaWiki are allowed(see Sanitizer::isReservedDataAttribute). 'DeleteUnknownPreferences':Called by the cleanupPreferences.php maintenance script to build a WHERE clause with which to delete preferences that are not known about. This hook is used by extensions that have dynamically-named preferences that should not be deleted in the usual cleanup process. For example, the Gadgets extension creates preferences prefixed with 'gadget-', and so anything with that prefix is excluded from the deletion. &where:An array that will be passed as the $cond parameter to IDatabase::select() to determine what will be deleted from the user_properties table. $db:The IDatabase object, useful for accessing $db->buildLike() etc. 'DifferenceEngineAfterLoadNewText':called in DifferenceEngine::loadNewText() after the new revision 's content has been loaded into the class member variable $differenceEngine->mNewContent but before returning true from this function. $differenceEngine:DifferenceEngine object 'DifferenceEngineLoadTextAfterNewContentIsLoaded':called in DifferenceEngine::loadText() after the new revision 's content has been loaded into the class member variable $differenceEngine->mNewContent but before checking if the variable 's value is null. This hook can be used to inject content into said class member variable. $differenceEngine:DifferenceEngine object 'DifferenceEngineMarkPatrolledLink':Allows extensions to change the "mark as patrolled" link which is shown both on the diff header as well as on the bottom of a page, usually wrapped in a span element which has class="patrollink". $differenceEngine:DifferenceEngine object & $markAsPatrolledLink:The "mark as patrolled" link HTML(string) $rcid:Recent change ID(rc_id) for this change(int) 'DifferenceEngineMarkPatrolledRCID':Allows extensions to possibly change the rcid parameter. For example the rcid might be set to zero due to the user being the same as the performer of the change but an extension might still want to show it under certain conditions. & $rcid:rc_id(int) of the change or 0 $differenceEngine:DifferenceEngine object $change:RecentChange object $user:User object representing the current user 'DifferenceEngineNewHeader':Allows extensions to change the $newHeader variable, which contains information about the new revision, such as the revision 's author, whether the revision was marked as a minor edit or not, etc. $differenceEngine:DifferenceEngine object & $newHeader:The string containing the various #mw-diff-otitle[1-5] divs, which include things like revision author info, revision comment, RevisionDelete link and more $formattedRevisionTools:Array containing revision tools, some of which may have been injected with the DiffRevisionTools hook $nextlink:String containing the link to the next revision(if any) $status
Set options of the Parser.
Content null $mContentObject
Content of the main slot of $this->mRevision.
static useFileCache(IContextSource $context, $mode=self::MODE_NORMAL)
Check if pages can be cached for this request/user.
IContextSource null $mContext
The context this Article is executed in.
static errorBox( $html, $heading='')
Return an error box.
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
Interface for type hinting (accepts WikiPage, Article, ImagePage, CategoryPage)
return true to allow those checks to and false if checking is done remove or add to the links of a group of changes in EnhancedChangesList Hook subscribers can return false to omit this line from recentchanges use this to change the tables headers change it to an object instance and return false override the list derivative used the name of the old file & $article
isRedirect()
Call to WikiPage function for backwards compatibility.
getCategories()
Call to WikiPage function for backwards compatibility.
doDeleteArticleReal( $reason, $suppress=false, $u1=null, $u2=null, &$error='', User $user=null, $tags=[], $immediate=false)
Call to WikiPage function for backwards compatibility.
static formatRobotPolicy( $policy)
Converts a String robot policy into an associative array, to allow merging of several policies using ...
getRedirectTarget()
Call to WikiPage function for backwards compatibility.
view()
This is the default action of the index.php entry point: just view the page of the given title.
static newFromId( $id, $flags=0)
Load a page revision from a given revision ID number.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on and they can depend only on the ResourceLoaderContext $context
static listDropDownOptionsOoui( $options)
Convert options for a drop-down box into a format accepted by OOUI\DropdownInputWidget etc.
getContentModel()
Call to WikiPage function for backwards compatibility.
getUserText( $audience=Revision::FOR_PUBLIC, User $user=null)
Call to WikiPage function for backwards compatibility.
getLinksTimestamp()
Call to WikiPage function for backwards compatibility.
bool $disableSectionEditForRender
Whether render() was called.
getOldIDFromRequest()
Sets $this->mRedirectUrl to a correct URL if the query parameters are incorrect.
showPatrolFooter()
If patrol is possible, output a patrol UI box.
if(!isset( $args[0])) $lang
static newFromConds( $conds, $fname=__METHOD__, $dbType=DB_REPLICA)
Find the first recent change matching some specific conditions.
tryFileCache()
checkLastModified returns true if it has taken care of all output to the client that is necessary for...
getContentHandler()
Call to WikiPage function for backwards compatibility.
makeFetchErrorContent()
Returns a Content object representing any error in $this->fetchContent, or null if there is no such e...
clearPreparedEdit()
Call to WikiPage function for backwards compatibility.
Page view caching in the file system.
lockAndGetLatest()
Call to WikiPage function for backwards compatibility.
supportsSections()
Call to WikiPage function for backwards compatibility.
getOldestRevision()
Call to WikiPage function for backwards compatibility.
getDeletionUpdates(Content $content=null)
Call to WikiPage function for backwards compatibility.
checkTouched()
Call to WikiPage function for backwards compatibility.
getRevision()
Call to WikiPage function for backwards compatibility.
Special handling for category description pages, showing pages, subcategories and file that belong to...
Class representing a MediaWiki article and history.
static newFatal( $message)
Factory function for fatal errors.
getCreator( $audience=Revision::FOR_PUBLIC, User $user=null)
Call to WikiPage function for backwards compatibility.
static newFromTarget( $specificTarget, $vagueTarget=null, $fromMaster=false)
Given a target and the target's type, get an existing Block object if possible.
wfReadOnly()
Check whether the wiki is in read-only mode.
Revision null $mRevision
Revision to be shown.
static newFromName( $name, $validate='valid')
Static factory method for creation from username.
static linkKnown( $target, $html=null, $customAttribs=[], $query=[], $options=[ 'known'])
Identical to link(), except $options defaults to 'known'.
showDiffPage()
Show a diff page according to current request variables.
static getForTitle(Title $title)
Returns the appropriate ContentHandler singleton for the given title.
$wgArticleRobotPolicies
Robot policies per article.
Class for viewing MediaWiki file description pages.
Show an error when a user tries to do something they do not have the necessary permissions for.
confirmDelete( $reason)
Output deletion confirmation dialog.
updateCategoryCounts(array $added, array $deleted, $id=0)
Call to WikiPage function for backwards compatibility.
doDeleteArticle( $reason, $suppress=false, $u1=null, $u2=null, &$error='', $immediate=false)
adjustDisplayTitle(ParserOutput $pOutput)
Adjust title for pages with displaytitle, -{T|}- or language conversion.
showNamespaceHeader()
Show a header specific to the namespace currently being viewed, like [[MediaWiki:Talkpagetext]].
shouldCheckParserCache(ParserOptions $parserOptions, $oldId)
Call to WikiPage function for backwards compatibility.
$wgUseRCPatrol
Use RC Patrolling to check for vandalism (from recent changes and watchlists) New pages and new files...
static openElement( $element, $attribs=null)
This opens an XML element.
$wgUseNPPatrol
Use new page patrolling to check new pages on Special:Newpages.
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
doDelete( $reason, $suppress=false, $immediate=false)
Perform a deletion and output success or failure messages.
protectDescriptionLog(array $limit, array $expiry)
Call to WikiPage function for backwards compatibility.
getRevisionRedirectTarget(RevisionRecord $revision)
Title null $mRedirectedFrom
Title from which we were redirected here, if any.
doEditContent(Content $content, $summary, $flags=0, $originalRevId=false, User $user=null, $serialFormat=null)
Call to WikiPage function for backwards compatibility.
Generic operation result class Has warning/error list, boolean status and arbitrary value.
getSubstituteContent()
Returns Content object to use when the page does not exist.
unprotect()
action=unprotect handler (alias)
insertRedirect()
Call to WikiPage function for backwards compatibility.
null for the wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
getRedirectedFrom()
Get the page this view was redirected from.
fetchContentObject()
Get text content object Does NOT follow redirects.
updateRedirectOn( $dbw, $redirectTitle, $lastRevIsRedirect=null)
Call to WikiPage function for backwards compatibility.
static newFromWikiPage(WikiPage $page, IContextSource $context)
Create an Article object of the appropriate class for the given page.
getTouched()
Call to WikiPage function for backwards compatibility.
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 an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
namespace and then decline to actually register it file or subcat img or subcat $title
getTitle()
Get the title object of the article.
updateRevisionOn( $dbw, $revision, $lastRevision=null, $lastRevIsRedirect=null)
Call to WikiPage function for backwards compatibility.
render()
Handle action=render.
wfDeprecated( $function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
insertProtectNullRevision( $revCommentMsg, array $limit, array $expiry, $cascade, $reason, $user=null)
Call to WikiPage function for backwards compatibility.
ParserOutput null false $mParserOutput
The ParserOutput generated for viewing the page, initialized by view().
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
exists()
Call to WikiPage function for backwards compatibility.
setRedirectedFrom(Title $from)
Tell the page view functions that this view was redirected from another page on the wiki.
$wgUseFileCache
This will cache static pages for non-logged-in users to reduce database traffic on public sites.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
static revUserTools( $rev, $isPublic=false)
Generate a user tool link cluster if the current user is allowed to view it.
applyContentOverride(Content $override)
Applies a content override by constructing a fake Revision object and assigning it to mRevision.
__construct(Title $title, $oldId=null)
Constructor and clear the article.
null for the wiki Added in
showDeletedRevisionHeader()
If the revision requested for view is deleted, check permissions.
isFileCacheable( $mode=HTMLFileCache::MODE_NORMAL)
Check if the page can be cached.
doRollback( $fromP, $summary, $token, $bot, &$resultDetails, User $user=null)
getTitle()
Get the title object of the article.
Class to simplify the use of log pages.
setOldSubtitle( $oldid=0)
Generate the navigation links when browsing through an article revisions It shows the information as:...
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
getPage()
Get the WikiPage object of this instance.
getContext()
Gets the context this Article is executed in.
static isIP( $name)
Does the string match an anonymous IP address?
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
ParserOptions null $mParserOptions
ParserOptions object for $wgUser articles.
static doWatchOrUnwatch( $watch, Title $title, User $user)
Watch or unwatch a page.
getComment( $audience=Revision::FOR_PUBLIC, User $user=null)
Call to WikiPage function for backwards compatibility.
pageDataFromId( $dbr, $id, $options=[])
Call to WikiPage function for backwards compatibility.
getRobotPolicy( $action, ParserOutput $pOutput=null)
Get the robot policy to be used for the current view.
insertOn( $dbw, $pageId=null)
Call to WikiPage function for backwards compatibility.
static makeExternalLink( $url, $text, $escape=true, $linktype='', $attribs=[], $title=null)
Make an external link.
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
getRedirectURL( $rt)
Call to WikiPage function for backwards compatibility.
static showLogExtract(&$out, $types=[], $page='', $user='', $param=[])
Show log extract.
static newFromID( $id)
Constructor from a page id.
getUndoContent(Revision $undo, Revision $undoafter=null)
Call to WikiPage function for backwards compatibility.
prepareContentForEdit(Content $content, $revision=null, User $user=null, $serialFormat=null, $useCache=true)
Call to WikiPage function for backwards compatibility.
$wgDeleteRevisionsLimit
Optional to restrict deletion of pages with higher revision counts to users with the 'bigdelete' perm...
The wiki should then use memcached to cache various data To use multiple just add more items to the array To increase the weight of a make its entry a array("192.168.0.1:11211", 2))
int $mRevIdFetched
Revision ID of revision that was loaded.
$wgUseFilePatrol
Use file patrolling to check new files on Special:Newfiles.
getLatest()
Call to WikiPage function for backwards compatibility.
wfDebug( $text, $dest='all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
isCurrent()
Returns true if the currently-referenced revision is the current edit to this page (and it exists).
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global list
static makeContent( $text, Title $title=null, $modelId=null, $format=null)
Convenience function for creating a Content object from a given textual representation.
getAutoDeleteReason(&$hasHistory)
Call to WikiPage function for backwards compatibility.
bool $mContentLoaded
Is the target revision loaded? Set by fetchRevisionRecord().
setParserOptions(ParserOptions $options)
Override the ParserOptions used to render the primary article wikitext.
isCountable( $editInfo=false)
Call to WikiPage function for backwards compatibility.
if(defined( 'MW_SETUP_CALLBACK')) $fname
Customization point after all loading (constants, functions, classes, DefaultSettings,...
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction you ll probably need to make sure the header is varied on $request
static hidden( $name, $value, array $attribs=[])
Convenience function to produce an input element with type=hidden.
doPurge()
Call to WikiPage function for backwards compatibility.
static revComment(Revision $rev, $local=false, $isPublic=false)
Wrap and format the given revision's comment block, if the current user is allowed to view it.
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' returning false will NOT prevent logging $e
hasViewableContent()
Call to WikiPage function for backwards compatibility.
int null $mOldId
The oldid of the article that was requested to be shown, 0 for the current revision.
getContributors()
Call to WikiPage function for backwards compatibility.
static newGood( $value=null)
Factory function for good results.
loadFromRow( $data, $from)
Call to WikiPage function for backwards compatibility.
getEmptyPageParserOutput(ParserOptions $options)
Returns ParserOutput to use when a page does not exist.
static getRevDeleteLink(User $user, Revision $rev, Title $title)
Get a revision-deletion link, or disabled link, or nothing, depending on user permissions & the setti...
protect()
action=protect handler
getTimestamp()
Call to WikiPage function for backwards compatibility.
static link( $target, $html=null, $customAttribs=[], $query=[], $options=[])
This function returns an HTML link to the given target.
static newCanonical( $context=null, $userLang=null)
Creates a "canonical" ParserOptions object.
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
getMinorEdit()
Call to WikiPage function for backwards compatibility.
commitRollback( $fromP, $summary, $bot, &$resultDetails, User $guser=null)
$wgNamespaceRobotPolicies
Robot policies per namespaces.
getParserOutput( $oldid=null, User $user=null)
#-
getUser( $audience=Revision::FOR_PUBLIC, User $user=null)
Call to WikiPage function for backwards compatibility.
getContentObject()
Returns a Content object representing the pages effective display content, not necessarily the revisi...
followRedirect()
Call to WikiPage function for backwards compatibility.
getHiddenCategories()
Call to WikiPage function for backwards compatibility.
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 see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output modifiable modifiable after all normalizations have been except for the $wgMaxImageArea check set to true or false to override the $wgMaxImageArea check result gives extension the possibility to transform it themselves $handler
static getMain()
Get the RequestContext object associated with the main request.
static isValid( $ip)
Validate an IP address.
setTimestamp( $ts)
Call to WikiPage function for backwards compatibility.
Interface for objects which can provide a MediaWiki context on request.
WikiPage null $mPage
The WikiPage object of this instance.
__get( $fname)
Use PHP's magic __get handler to handle accessing of raw WikiPage fields for backwards compatibility.
Base interface for content objects.
replaceSectionAtRev( $sectionId, Content $sectionContent, $sectionTitle='', $baseRevId=null)
Call to WikiPage function for backwards compatibility.
static isRegistered( $name)
Returns true if a hook has a function registered to it.
This list may contain false positives That usually means there is additional text with links below the first Each row contains links to the first and second as well as the first line of the second redirect text
fetchRevisionRecord()
Fetches the revision to work on.
null for the wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify as strings Extensions should add to this list prev or next refreshes the diff cache $unhide
Represents a title within MediaWiki.
static makeUrl( $name, $urlaction='')
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 & $options
replaceSectionContent( $sectionId, Content $sectionContent, $sectionTitle='', $edittime=null)
Call to WikiPage function for backwards compatibility.
getRevIdFetched()
Use this to fetch the rev ID used on page views.
Wrapper allowing us to handle a system message as a Content object.
makeParserOptions( $context)
Call to WikiPage function for backwards compatibility.
showRedirectedFromHeader()
If this request is a redirect view, send "redirected from" subtitle to the output.
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc $rev
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
static isInRCLifespan( $timestamp, $tolerance=0)
Check whether the given timestamp is new enough to have a RC row with a given tolerance as the recent...
usually copyright or history_copyright This message must be in HTML not wikitext & $link
getId()
Call to WikiPage function for backwards compatibility.
getActionOverrides()
Call to WikiPage function for backwards compatibility.
string bool $mRedirectUrl
URL to redirect to or false if none.
doUpdateRestrictions(array $limit, array $expiry, &$cascade, $reason, User $user)
updateRestrictions( $limit=[], $reason='', &$cascade=0, $expiry=[])
protectDescription(array $limit, array $expiry)
Call to WikiPage function for backwards compatibility.
getParserOptions()
Get parser options suitable for rendering the primary article wikitext.
$wgRedirectSources
If local interwikis are set up which allow redirects, set this regexp to restrict URLs which will be ...
updateIfNewerOn( $dbw, $revision)
Call to WikiPage function for backwards compatibility.
Class for viewing MediaWiki article and history.
doDeleteUpdates( $id, Content $content=null, $revision=null, User $user=null)
Call to WikiPage function for backwards compatibility.
pageDataFromTitle( $dbr, $title, $options=[])
Call to WikiPage function for backwards compatibility.
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 MediaWikiServices
$wgDebugToolbar
Display the new debugging toolbar.
triggerOpportunisticLinksUpdate(ParserOutput $parserOutput)
Call to WikiPage function for backwards compatibility.
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 use $formDescriptor instead 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 "<
const POST_EDIT_COOKIE_KEY_PREFIX
Prefix of key for cookie used to pass post-edit state.
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
setContext( $context)
Sets the context this Article is executed in.
static newFromID( $id, $flags=0)
Create a new Title from an article ID.
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
insertRedirectEntry(Title $rt, $oldLatest=null)
Call to WikiPage function for backwards compatibility.
$wgDefaultRobotPolicy
Default robot policy.
getRevisionFetched()
Get the fetched Revision object depending on request parameters or null on failure.
static getCanonicalName( $index)
Returns the canonical (English) name for a given index.
viewRedirect( $target, $appendSubtitle=true, $forceKnown=false)
Return the HTML for the top of a redirect page.
loadPageData( $from='fromdb')
Call to WikiPage function for backwards compatibility.
Internationalisation code.
doEditUpdates(Revision $revision, User $user, array $options=[])
Call to WikiPage function for backwards compatibility.
__set( $fname, $fvalue)
Use PHP's magic __set handler to handle setting of raw WikiPage fields for backwards compatibility.
showViewFooter()
Show the footer section of an ordinary page view.
static getRedirectHeaderHtml(Language $lang, $target, $forceKnown=false)
Return the HTML for the top of a redirect page.
static listDropDownOptions( $list, $params=[])
Build options for a drop-down box from a textual list.
static newFromTitle( $title, IContextSource $context)
Create an Article object of the appropriate class for the given page.
generateReason(&$hasHistory)
static purgePatrolFooterCache( $articleID)
Purge the cache used to check if it is worth showing the patrol footer For example,...
doViewUpdates(User $user, $oldid=0)
Call to WikiPage function for backwards compatibility.
Status null $fetchResult
represents the outcome of fetchRevisionRecord().
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 see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out