272 'Accept-Encoding' => [
'match=gzip' ],
316 # Extensions should use `new RequestContext` instead of `new OutputPage` now.
329 public function redirect ( $url, $responsecode =
'302' ) {
330 # Strip newlines as a paranoia check for header injection in PHP<5.1.2
331 $this->mRedirect = str_replace(
"\n" ,
'' , $url );
332 $this->mRedirectCode = $responsecode;
353 $this->copyrightUrl = $url;
362 $this->mStatusCode = $statusCode;
373 array_push( $this->mMetatags, [
$name , $val ] );
394 array_push( $this->mLinktags, $linkarr );
425 $this->mCanonicalUrl = $url;
445 # note: buggy CC software only reads first "meta" link
446 static $haveMeta =
false ;
448 return 'alternate meta' ;
463 $this->mScripts .= $script;
477 array_push( $this->mExtStyles, $url );
501 if ( substr( $file, 0, 1 ) ==
'/' || preg_match(
'#^[a-z]*://#i' , $file ) ) {
504 $path = $this->
getConfig ()->get(
'StylePath' ) .
"/common/{$file}" ;
534 $filteredModules = [];
535 foreach ( $modules
as $val ) {
539 && ( is_null( $position ) || $module->getPosition() == $position )
540 && ( !$this->mTarget || in_array( $this->mTarget, $module->getTargets() ) )
542 $filteredModules[] = $val;
545 return $filteredModules;
556 public function getModules ( $filter =
false , $position = null, $param =
'mModules' ) {
557 $modules = array_values( array_unique( $this->$param ) );
571 $this->mModules = array_merge( $this->mModules, (
array )$modules );
583 return $this->
getModules ( $filter, $position,
'mModuleScripts' );
594 $this->mModuleScripts = array_merge( $this->mModuleScripts, (
array )$modules );
606 return $this->
getModules ( $filter, $position,
'mModuleStyles' );
619 $this->mModuleStyles = array_merge( $this->mModuleStyles, (
array )$modules );
658 $this->mTarget = $target;
693 return isset( $this->mHeadItems[
$name ] );
713 $this->mArticleBodyOnly = $only;
744 if ( isset( $this->mProperties[
$name ] ) ) {
745 return $this->mProperties[
$name ];
764 wfDebug ( __METHOD__ .
": CACHE DISABLED, NO TIMESTAMP\n" );
768 if ( !$config->get(
'CachePages' ) ) {
769 wfDebug ( __METHOD__ .
": CACHE DISABLED\n" );
776 'user' => $this->
getUser ()->getTouched(),
777 'epoch' => $config->get(
'CacheEpoch' )
779 if ( $config->get(
'UseSquid' ) ) {
781 $modifiedTimes[
'sepoch' ] =
wfTimestamp (
TS_MW , time() - $config->get(
'SquidMaxage' ) );
783 Hooks::run (
'OutputPageCheckLastModified' , [ &$modifiedTimes ] );
785 $maxModified = max( $modifiedTimes );
788 $clientHeader = $this->
getRequest ()->getHeader(
'If-Modified-Since' );
789 if ( $clientHeader ===
false ) {
790 wfDebug ( __METHOD__ .
": client did not send If-Modified-Since header" ,
'private' );
794 # IE sends sizes after the date like this:
795 # Wed, 20 Aug 2003 06:51:19 GMT; length=5202
796 # this breaks strtotime().
797 $clientHeader = preg_replace(
'/;.*$/' ,
'' , $clientHeader );
799 MediaWiki\suppressWarnings();
800 $clientHeaderTime = strtotime( $clientHeader );
801 MediaWiki\restoreWarnings();
802 if ( !$clientHeaderTime ) {
804 .
": unable to parse the client's If-Modified-Since header: $clientHeader\n" );
812 if ( $info !==
'' ) {
818 wfDebug ( __METHOD__ .
": client sent If-Modified-Since: " .
820 wfDebug ( __METHOD__ .
": effective Last-Modified: " .
822 if ( $clientHeaderTime < $maxModified ) {
823 wfDebug ( __METHOD__ .
": STALE, $info" ,
'private' );
828 # Give a 304 Not Modified response code and disable body output
829 wfDebug ( __METHOD__ .
": NOT MODIFIED, $info" ,
'private' );
830 ini_set(
'zlib.output_compression' , 0 );
831 $this->
getRequest ()->response()->statusHeader( 304 );
864 if ( isset( $policy[
'index' ] ) ) {
867 if ( isset( $policy[
'follow' ] ) ) {
880 $policy = trim( $policy );
881 if ( in_array( $policy, [
'index' ,
'noindex' ] ) ) {
882 $this->mIndexPolicy = $policy;
894 $policy = trim( $policy );
895 if ( in_array( $policy, [
'follow' ,
'nofollow' ] ) ) {
896 $this->mFollowPolicy = $policy;
907 $this->mPageTitleActionText = $text;
929 $this->mHTMLtitle =
$name ;
948 $this->mRedirectedFrom =
$t ;
966 # change "<script>foo&bar</script>" to "<script>foo&bar</script>"
967 # but leave "<i>foobar</i>" alone
969 $this->mPagetitle = $nameWithTags;
971 # change "<i>foo&bar</i>" to "foo&bar"
974 ->inContentLanguage()
1012 if ( $str instanceof
Message ) {
1013 $this->mSubtitle[] = $str->setContext( $this->
getContext () )->parse();
1015 $this->mSubtitle[] = $str;
1029 $query [
'redirect' ] =
'no' ;
1049 $this->mSubtitle = [];
1058 return implode(
"<br />\n\t\t\t\t" , $this->mSubtitle );
1066 $this->mPrintable =
true ;
1082 $this->mDoNothing =
true ;
1124 $this->mFeedLinks = [];
1138 $this->mFeedLinks = [];
1142 if ( is_string( $val ) ) {
1156 if ( in_array( $format, $this->
getConfig ()->
get (
'AdvertisedFeedTypes' ) ) ) {
1157 $this->mFeedLinks[$format] = $href;
1166 return count( $this->mFeedLinks ) > 0;
1194 $this->mIsarticle = $v;
1196 $this->mIsArticleRelated = $v;
1217 $this->mIsArticleRelated = $v;
1219 $this->mIsarticle =
false ;
1239 $this->mLanguageLinks += $newLinkArray;
1249 $this->mLanguageLinks = $newLinkArray;
1269 if ( !is_array( $categories ) || count( $categories ) == 0 ) {
1273 # Add the links to a LinkBatch
1278 # Fetch existence plus the hiddencat property
1280 $fields = [
'page_id' ,
'page_namespace' ,
'page_title' ,
'page_len' ,
1281 'page_is_redirect' ,
'page_latest' ,
'pp_value' ];
1283 if ( $this->
getConfig ()->
get (
'ContentHandlerUseDB' ) ) {
1284 $fields[] =
'page_content_model' ;
1286 if ( $this->
getConfig ()->
get (
'PageLanguageUseDB' ) ) {
1287 $fields[] =
'page_lang' ;
1290 $res =
$dbr ->select( [
'page' ,
'page_props' ],
1292 $lb->constructSet(
'page' ,
$dbr ),
1295 [
'page_props' => [
'LEFT JOIN' , [
1296 'pp_propname' =>
'hiddencat' ,
1301 # Add the results to the link cache
1304 # Set all the values to 'normal'.
1305 $categories = array_fill_keys( array_keys( $categories ),
'normal' );
1307 # Mark hidden categories
1308 foreach (
$res as $row ) {
1309 if ( isset( $row->pp_value ) ) {
1310 $categories[$row->page_title] =
'hidden' ;
1315 $outputPage = $this;
1316 # Add the remaining categories to the skin
1318 'OutputPageMakeCategoryLinks' ,
1319 [ &$outputPage, $categories, &$this->mCategoryLinks ] )
1321 foreach ( $categories
as $category =>
$type ) {
1323 $category = (
string )$category;
1324 $origcategory = $category;
1329 $wgContLang->findVariantLink( $category,
$title ,
true );
1330 if ( $category != $origcategory && array_key_exists( $category, $categories ) ) {
1333 $text = $wgContLang->convertHtml(
$title ->getText() );
1334 $this->mCategories[] =
$title ->getText();
1346 $this->mCategoryLinks = [];
1383 ksort( $this->mIndicators );
1408 $text = $this->
msg (
'helppage-top-gethelp' )->escaped();
1410 if ( $overrideBaseUrl ) {
1413 $toUrlencoded =
wfUrlencode ( str_replace(
' ' ,
'_' , $to ) );
1414 $helpUrl =
"//www.mediawiki.org/wiki/Special:MyLanguage/$toUrlencoded" ;
1421 'target' =>
'_blank' ,
1422 'class' =>
'mw-helplink' ,
1446 if ( $this->
getConfig ()->
get (
'AllowSiteCSSOnRestrictedPages' ) ) {
1465 return min( array_values( $this->mAllowedModules ) );
1467 return isset( $this->mAllowedModules[
$type ] )
1468 ? $this->mAllowedModules[
$type ]
1501 $this->mBodytext .= $text;
1521 $this->mBodytext =
'' ;
1545 $anonPO->setEditSection(
false );
1546 $anonPO->setAllowUnsafeRawHtml(
false );
1547 if ( !
$options ->matches( $anonPO ) ) {
1553 if ( !$this->mParserOptions ) {
1559 $po->setEditSection(
false );
1560 $po->setAllowUnsafeRawHtml(
false );
1561 $po->isBogus =
true ;
1569 $this->mParserOptions->setEditSection(
false );
1570 $this->mParserOptions->setAllowUnsafeRawHtml(
false );
1576 return wfSetVar ( $this->mParserOptions, null,
true );
1590 $val = is_null( $revid ) ? null : intval( $revid );
1591 return wfSetVar ( $this->mRevisionId, $val );
1632 if ( $file instanceof
File && $file->
exists () ) {
1633 $val = [
'time' => $file->getTimestamp(),
'sha1' => $file->getSha1() ];
1635 return wfSetVar ( $this->mFileVersion, $val,
true );
1676 public function addWikiText ( $text, $linestart =
true , $interface =
true ) {
1728 $tidy =
false , $interface =
false
1733 $oldTidy = $popts->setTidy( $tidy );
1734 $popts->setInterfaceMessage( (
bool )$interface );
1737 $text, $title, $popts,
1738 $linestart,
true , $this->mRevisionId
1741 $popts->setTidy( $oldTidy );
1771 $this->mHideNewSectionLink =
$parserOutput ->getHideNewSection();
1777 $this->mHeadItems = array_merge( $this->mHeadItems,
$parserOutput ->getHeadItems() );
1782 $this->mPreventClickjacking = $this->mPreventClickjacking
1787 if ( isset( $this->mTemplateIds[$ns] ) ) {
1788 $this->mTemplateIds[$ns] = $dbks + $this->mTemplateIds[$ns];
1790 $this->mTemplateIds[$ns] = $dbks;
1795 $this->mImageTimeKeys[$dbk] = $data;
1799 $parserOutputHooks = $this->
getConfig ()->get(
'ParserOutputHooks' );
1801 list ( $hookName, $data ) = $hookInfo;
1802 if ( isset( $parserOutputHooks[$hookName] ) ) {
1803 call_user_func( $parserOutputHooks[$hookName], $this,
$parserOutput , $data );
1816 $outputPage = $this;
1817 Hooks::run (
'LanguageLinks' , [ $this->
getTitle (), &$this->mLanguageLinks, &$linkFlags ] );
1847 $outputPage = $this;
1848 Hooks::run (
'OutputPageBeforeHTML' , [ &$outputPage, &$text ] );
1863 $parserOutput ->setEditSectionTokens( $this->mEnableSectionEditLinks );
1890 public function parse ( $text, $linestart =
true , $interface =
false , $language = null ) {
1893 if ( is_null( $this->
getTitle () ) ) {
1894 throw new MWException (
'Empty $mTitle in ' . __METHOD__ );
1899 $popts->setInterfaceMessage(
true );
1901 if ( $language !== null ) {
1902 $oldLang = $popts->setTargetLanguage( $language );
1907 $linestart,
true , $this->mRevisionId
1911 $popts->setInterfaceMessage(
false );
1913 if ( $language !== null ) {
1914 $popts->setTargetLanguage( $oldLang );
1930 public function parseInline ( $text, $linestart =
true , $interface =
false ) {
1931 $parsed = $this->
parse ( $text, $linestart, $interface );
1949 $this->mCdnMaxage = min( $maxage, $this->mCdnMaxageLimit );
1959 $this->mCdnMaxageLimit = min( $maxage, $this->mCdnMaxageLimit );
1971 return wfSetVar ( $this->mEnableClientCache, $state );
1981 if ( $cookies === null ) {
1983 $cookies = array_merge(
1984 SessionManager::singleton()->getVaryCookies(),
1988 $config->get(
'CacheVaryCookies' )
1990 Hooks::run (
'GetCacheVaryCookies' , [ $this, &$cookies ] );
2004 if (
$request ->getCookie( $cookieName,
'' ,
'' ) !==
'' ) {
2005 wfDebug ( __METHOD__ .
": found $cookieName\n" );
2009 wfDebug ( __METHOD__ .
": no cache-varying cookies found\n" );
2022 if ( !array_key_exists( $header, $this->mVaryHeader ) ) {
2023 $this->mVaryHeader[$header] = [];
2025 if ( !is_array( $option ) ) {
2028 $this->mVaryHeader[$header] = array_unique( array_merge( $this->mVaryHeader[$header], $option ) );
2043 foreach ( SessionManager::singleton()->getVaryHeaders()
as $header =>
$options ) {
2046 return 'Vary: ' . implode(
', ' , array_keys( $this->mVaryHeader ) );
2057 $cookiesOption = [];
2058 foreach ( $cvCookies
as $cookieName ) {
2059 $cookiesOption[] =
'param=' . $cookieName;
2063 foreach ( SessionManager::singleton()->getVaryHeaders()
as $header =>
$options ) {
2068 foreach ( $this->mVaryHeader
as $header => $option ) {
2069 $newheader = $header;
2070 if ( is_array( $option ) && count( $option ) > 0 ) {
2071 $newheader .=
';' . implode(
';' , $option );
2073 $headers[] = $newheader;
2075 $key =
'Key: ' . implode(
',' , $headers );
2095 if ( !$this->
getRequest ()->getCheck(
'variant' ) &&
$lang ->hasVariants() ) {
2096 $variants =
$lang ->getVariants();
2098 foreach ( $variants
as $variant ) {
2099 if ( $variant ===
$lang ->getCode() ) {
2102 $aloption[] =
'substr=' . $variant;
2107 $variantBCP47 =
wfBCP47 ( $variant );
2108 if ( $variantBCP47 !== $variant ) {
2109 $aloption[] =
'substr=' . $variantBCP47;
2128 $this->mPreventClickjacking = $enable;
2137 $this->mPreventClickjacking =
false ;
2159 if ( $config->get(
'BreakFrames' ) ) {
2161 } elseif ( $this->mPreventClickjacking && $config->get(
'EditPageFrameOptions' ) ) {
2162 return $config->get(
'EditPageFrameOptions' );
2174 $response ->header(
"ETag: $this->mETag" );
2180 # don't serve compressed data to clients who can't handle it
2181 # maintain different caches for logged-in users and non-logged in ones
2184 if ( $config->get(
'UseKeyHeader' ) ) {
2188 if ( $this->mEnableClientCache ) {
2190 $config->get(
'UseSquid' ) &&
2192 !SessionManager::getGlobalSession()->isPersistent() &&
2194 $this->mCdnMaxage != 0 &&
2197 if ( $config->get(
'UseESI' ) ) {
2198 # We'll purge the proxy cache explicitly, but require end user agents
2199 # to revalidate against the proxy on each visit.
2200 # Surrogate-Control controls our CDN, Cache-Control downstream caches
2201 wfDebug ( __METHOD__ .
": proxy caching with ESI; {$this->mLastModified} **" ,
'private' );
2202 # start with a shorter timeout for initial testing
2203 # header( 'Surrogate-Control: max-age=2678400+2678400, content="ESI/1.0"');
2204 $response ->header(
'Surrogate-Control: max-age=' . $config->get(
'SquidMaxage' )
2205 .
'+' . $this->mCdnMaxage .
', content="ESI/1.0"' );
2206 $response ->header(
'Cache-Control: s-maxage=0, must-revalidate, max-age=0' );
2208 # We'll purge the proxy cache for anons explicitly, but require end user agents
2209 # to revalidate against the proxy on each visit.
2210 # IMPORTANT! The CDN needs to replace the Cache-Control header with
2211 # Cache-Control: s-maxage=0, must-revalidate, max-age=0
2212 wfDebug ( __METHOD__ .
": local proxy caching; {$this->mLastModified} **" ,
'private' );
2213 # start with a shorter timeout for initial testing
2214 # header( "Cache-Control: s-maxage=2678400, must-revalidate, max-age=0" );
2215 $response ->header(
'Cache-Control: s-maxage=' . $this->mCdnMaxage
2216 .
', must-revalidate, max-age=0' );
2219 # We do want clients to cache if they can, but they *must* check for updates
2220 # on revisiting the page.
2221 wfDebug ( __METHOD__ .
": private caching; {$this->mLastModified} **" ,
'private' );
2222 $response ->header(
'Expires: ' . gmdate(
'D, d M Y H:i:s' , 0 ) .
' GMT' );
2223 $response ->header(
"Cache-Control: private, must-revalidate, max-age=0" );
2225 if ( $this->mLastModified ) {
2226 $response ->header(
"Last-Modified: {$this->mLastModified}" );
2229 wfDebug ( __METHOD__ .
": no caching **" ,
'private' );
2231 # In general, the absence of a last modified header should be enough to prevent
2232 # the client from using its cache. We send a few other things just to make sure.
2233 $response ->header(
'Expires: ' . gmdate(
'D, d M Y H:i:s' , 0 ) .
' GMT' );
2234 $response ->header(
'Cache-Control: no-cache, no-store, max-age=0, must-revalidate' );
2235 $response ->header(
'Pragma: no-cache' );
2244 if ( $this->mDoNothing ) {
2251 if ( $this->mRedirect !=
'' ) {
2252 # Standards require redirect URLs to be absolute
2258 if (
Hooks::run (
"BeforePageRedirect" , [ $this, &$redirect, &
$code ] ) ) {
2260 if ( !$config->get(
'DebugRedirects' ) ) {
2265 if ( $config->get(
'VaryOnXFP' ) ) {
2270 $response ->header(
"Content-Type: text/html; charset=utf-8" );
2271 if ( $config->get(
'DebugRedirects' ) ) {
2272 $url = htmlspecialchars( $redirect );
2273 print "<html>\n<head>\n<title>Redirect</title>\n</head>\n<body>\n" ;
2274 print "<p>Location: <a href=\"$url\">$url</a></p>\n" ;
2275 print "</body>\n</html>\n" ;
2277 $response ->header(
'Location: ' . $redirect );
2282 } elseif ( $this->mStatusCode ) {
2283 $response ->statusHeader( $this->mStatusCode );
2286 # Buffer output; final headers may depend on later processing
2289 $response ->header(
'Content-type: ' . $config->get(
'MimeType' ) .
'; charset=UTF-8' );
2290 $response ->header(
'Content-language: ' . $config->get(
'LanguageCode' ) );
2294 $response ->header(
'X-UA-Compatible: IE=Edge' );
2298 if ( $frameOptions ) {
2299 $response ->header(
"X-Frame-Options: $frameOptions" );
2302 if ( $this->mArticleBodyOnly ) {
2307 $modules = $sk->getDefaultModules();
2313 'mediawiki.page.startup' ,
2318 if ( $config->get(
'ResponsiveImages' ) ) {
2319 $coreModules[] =
'mediawiki.hidpi' ;
2323 foreach ( $modules
as $group ) {
2329 $outputPage = $this;
2332 Hooks::run (
'BeforePageDisplay' , [ &$outputPage, &$sk ] );
2344 Hooks::run (
'AfterFinalPageOutput' , [ $this ] );
2368 if ( $htmlTitle !==
false ) {
2374 $this->mRedirect =
'' ;
2398 if ( $msg instanceof Message ) {
2400 trigger_error(
'Argument ignored: $params. The message parameters argument '
2401 .
'is discarded when the $msg argument is a Message object instead of '
2402 .
'a string.' , E_USER_NOTICE );
2404 $this->
addHTML ( $msg->parseAsBlock() );
2424 if ( in_array( $action, [
'read' ,
'edit' ,
'createpage' ,
'createtalk' ,
'upload' ] )
2425 && $this->
getUser ()->isAnon() && count( $errors ) == 1 && isset( $errors[0][0] )
2426 && ( $errors[0][0] ==
'badaccess-groups' || $errors[0][0] ==
'badaccess-group0' )
2430 $displayReturnto = null;
2432 # Due to bug 32276, if a user does not have read permissions,
2433 # $this->getTitle() will just give Special:Badtitle, which is
2434 # not especially useful as a returnto parameter. Use the title
2435 # from the request instead, if there was one.
2438 if ( $action ==
'edit' ) {
2439 $msg =
'whitelistedittext' ;
2440 $displayReturnto = $returnto;
2441 } elseif ( $action ==
'createpage' || $action ==
'createtalk' ) {
2442 $msg =
'nocreatetext' ;
2443 } elseif ( $action ==
'upload' ) {
2444 $msg =
'uploadnologintext' ;
2446 $msg =
'loginreqpagetext' ;
2453 $query [
'returnto' ] = $returnto->getPrefixedText();
2456 $returntoquery =
$request ->getValues();
2457 unset( $returntoquery[
'title' ] );
2458 unset( $returntoquery[
'returnto' ] );
2459 unset( $returntoquery[
'returntoquery' ] );
2465 $this->
msg (
'loginreqlink' )->escaped(),
2471 $this->
addHTML ( $this->
msg ( $msg )->rawParams( $loginLink )->
parse () );
2473 # Don't return to a page the user can't read otherwise
2474 # we'll end up in a pointless loop
2475 if ( $displayReturnto && $displayReturnto->userCan(
'read' , $this->getUser() ) ) {
2505 if ( $action == null ) {
2506 $text = $this->
msg (
'permissionserrorstext' , count( $errors ) )->plain() .
"\n\n" ;
2508 $action_desc = $this->
msg (
"action-$action" )->plain();
2510 'permissionserrorstext-withaction' ,
2513 )->plain() .
"\n\n" ;
2516 if ( count( $errors ) > 1 ) {
2517 $text .=
'<ul class="permissions-errors">' .
"\n" ;
2519 foreach ( $errors
as $error ) {
2521 $text .= call_user_func_array( [ $this,
'msg' ], $error )->plain();
2526 $text .=
"<div class=\"permissions-errors\">\n" .
2527 call_user_func_array( [ $this,
'msg' ], reset( $errors ) )->plain() .
2546 if ( func_num_args() > 0 ) {
2547 throw new MWException ( __METHOD__ .
' no longer accepts arguments since 1.25.' );
2575 if ( $lag >= $config->get(
'SlaveLagWarning' ) ) {
2576 $message = $lag < $config->get(
'SlaveLagCritical' )
2579 $wrap =
Html::rawElement (
'div' , [
'class' =>
"mw-{$message}" ],
"\n$1\n" );
2619 $link = $this->
msg (
'returnto' )->rawParams(
2621 $this->
addHTML (
"<p id=\"mw-returnto\">{$link}</p>\n" );
2632 public function returnToMain ( $unused = null, $returnto = null, $returntoquery = null ) {
2633 if ( $returnto == null ) {
2634 $returnto = $this->
getRequest ()->getText(
'returnto' );
2637 if ( $returntoquery == null ) {
2638 $returntoquery = $this->
getRequest ()->getText(
'returntoquery' );
2641 if ( $returnto ===
'' ) {
2645 if ( is_object( $returnto ) ) {
2646 $titleObj = $returnto;
2652 if ( !is_object( $titleObj ) || $titleObj->isExternal() ) {
2668 $sitedir = $wgContLang->getDir();
2678 # Don't bother with the newline if $head == ''
2679 $ret .=
"$openHead\n" ;
2700 $ret .= $item .
"\n" ;
2703 foreach ( $this->mHeadItems
as $item ) {
2704 $ret .= $item .
"\n" ;
2709 $ret .=
"$closeHead\n" ;
2713 $bodyClasses[] =
'mediawiki' ;
2715 # Classes for LTR/RTL directionality support
2716 $bodyClasses[] = $userdir;
2717 $bodyClasses[] =
"sitedir-$sitedir" ;
2719 if ( $this->
getLanguage ()->capitalizeAllNouns() ) {
2720 # A <body> class is probably not the best way to do this . . .
2721 $bodyClasses[] =
'capitalize-all-nouns' ;
2732 $bodyAttrs[
'class' ] = implode(
' ' , $bodyClasses );
2736 Hooks::run (
'OutputPageBodyAttributes' , [ $this, $sk, &$bodyAttrs ] );
2749 if ( is_null( $this->mResourceLoader ) ) {
2752 LoggerFactory::getInstance(
'resourceloader' )
2769 $modules = (
array )$modules;
2778 if ( !count( $modules ) ) {
2782 if ( count( $modules ) > 1 ) {
2784 $modules = array_unique( $modules );
2790 foreach ( $modules
as $name ) {
2792 $links[
'html' ] = array_merge( $links[
'html' ],
$link [
'html' ] );
2793 $links[
'states' ] +=
$link [
'states' ];
2799 if ( !is_null( $this->mTarget ) ) {
2804 $sortedModules = [];
2806 foreach ( $modules
as $name ) {
2808 # Check that we're allowed to include this module on this page
2816 || ( $this->mTarget && !in_array( $this->mTarget, $module->getTargets() ) )
2821 $sortedModules[$module->getSource()][$module->getGroup()][
$name ] = $module;
2824 foreach ( $sortedModules
as $source => $groups ) {
2825 foreach ( $groups
as $group => $grpModules ) {
2828 if ( ( $group ===
'user' || $group ===
'private' ) && $this->
getUser ()->isLoggedIn() ) {
2837 $this->
getSkin ()->getSkinName(),
2851 foreach ( $grpModules
as $key => $module ) {
2854 if ( $module->isKnownEmpty(
$context ) ) {
2855 unset( $grpModules[
$key ] );
2857 $links[
'states' ][
$key ] =
'ready' ;
2861 $isRaw |= $module->isRaw();
2865 if ( count( $grpModules ) === 0 ) {
2873 if ( $group ===
'private' ) {
2892 if ( $group ===
'user' ) {
2904 if (
$context ->getRaw() || $isRaw ) {
2908 'async' => !isset( $extraQuery[
'sync' ] ),
2919 foreach ( $grpModules
as $key => $module ) {
2921 if (
$key !==
'startup' ) {
2922 $links[
'states' ][
$key ] =
'loading' ;
2927 if ( $group ==
'noscript' ) {
2930 $links[
'html' ][] =
$link ;
2947 if ( !is_array( $link ) ) {
2951 $states += $link[
'states' ];
2957 if ( count( $states ) ) {
2963 return WrappedString::join(
"\n" ,
$html );
2989 return self::getHtmlFromLoaderLinks( $links );
3007 'document.documentElement.className = document.documentElement.className'
3008 .
'.replace( /(^|\s)client-nojs(\s|$)/, "$1client-js$2" );'
3019 $embedScripts = [
'user.options' ];
3045 return self::getHtmlFromLoaderLinks( $links );
3068 $modules = $this->
getModules (
true ,
'bottom' );
3081 if ( $this->
getConfig ()->
get (
'AllowUserJs' )
3083 && $this->
getTitle ()->isJsSubpage()
3089 [
'excludepage' => $this->
getTitle ()->getPrefixedDBkey() ]
3122 return self::getHtmlFromLoaderLinks( $links );
3150 if ( is_array(
$keys ) ) {
3174 $canonicalSpecialPageName =
false ; # bug 21115
3177 $ns = $title->getNamespace();
3180 : $title->getNsText();
3185 $relevantTitle = $sk->getRelevantTitle();
3186 $relevantUser = $sk->getRelevantUser();
3189 list ( $canonicalSpecialPageName, ) =
3193 $curRevisionId = $wikiPage->getLatest();
3194 $articleId = $wikiPage->getId();
3197 $lang = $title->getPageViewLanguage();
3200 $separatorTransTable =
$lang ->separatorTransformTable();
3201 $separatorTransTable = $separatorTransTable ? $separatorTransTable : [];
3202 $compactSeparatorTransTable = [
3203 implode(
"\t" , array_keys( $separatorTransTable ) ),
3204 implode(
"\t" , $separatorTransTable ),
3206 $digitTransTable =
$lang ->digitTransformTable();
3207 $digitTransTable = $digitTransTable ? $digitTransTable : [];
3208 $compactDigitTransTable = [
3209 implode(
"\t" , array_keys( $digitTransTable ) ),
3210 implode(
"\t" , $digitTransTable ),
3216 'wgCanonicalNamespace' => $canonicalNamespace,
3217 'wgCanonicalSpecialPageName' => $canonicalSpecialPageName,
3218 'wgNamespaceNumber' => $title->getNamespace(),
3219 'wgPageName' => $title->getPrefixedDBkey(),
3220 'wgTitle' => $title->getText(),
3221 'wgCurRevisionId' => $curRevisionId,
3223 'wgArticleId' => $articleId,
3225 'wgIsRedirect' => $title->isRedirect(),
3227 'wgUserName' =>
$user ->isAnon() ? null :
$user ->getName(),
3228 'wgUserGroups' =>
$user ->getEffectiveGroups(),
3231 'wgPageContentLanguage' =>
$lang ->getCode(),
3232 'wgPageContentModel' => $title->getContentModel(),
3233 'wgSeparatorTransformTable' => $compactSeparatorTransTable,
3234 'wgDigitTransformTable' => $compactDigitTransTable,
3235 'wgDefaultDateFormat' =>
$lang ->getDefaultDateFormat(),
3236 'wgMonthNames' =>
$lang ->getMonthNamesArray(),
3237 'wgMonthNamesShort' =>
$lang ->getMonthAbbreviationsArray(),
3238 'wgRelevantPageName' => $relevantTitle->getPrefixedDBkey(),
3239 'wgRelevantArticleId' => $relevantTitle->getArticleID(),
3243 if (
$user ->isLoggedIn() ) {
3245 $vars [
'wgUserEditCount' ] =
$user ->getEditCount();
3247 $vars [
'wgUserRegistration' ] = $userReg !== null ? ( $userReg * 1000 ) : null;
3251 $vars[
'wgUserNewMsgRevisionId' ] =
$user ->getNewMessageRevisionId();
3254 if ( $wgContLang->hasVariants() ) {
3255 $vars [
'wgUserVariant' ] = $wgContLang->getPreferredVariant();
3258 $vars [
'wgIsProbablyEditable' ] = $title->quickUserCan(
'edit' ,
$user )
3259 && ( $title->exists() || $title->quickUserCan(
'create' ,
$user ) );
3261 foreach ( $title->getRestrictionTypes()
as $type ) {
3262 $vars [
'wgRestriction' . ucfirst(
$type )] = $title->getRestrictions(
$type );
3265 if ( $title->isMainPage() ) {
3266 $vars [
'wgIsMainPage' ] =
true ;
3269 if ( $this->mRedirectedFrom ) {
3270 $vars [
'wgRedirectedFrom' ] = $this->mRedirectedFrom->getPrefixedDBkey();
3273 if ( $relevantUser ) {
3274 $vars [
'wgRelevantUserName' ] = $relevantUser->getName();
3299 $request ->getVal(
'action' ) !==
'submit' ||
3300 !
$request ->getCheck(
'wpPreview' ) ||
3308 if ( !$this->
getUser ()->isLoggedIn() ) {
3312 if ( !
$user ->matchEditToken(
$request ->getVal(
'wpEditToken' ) ) ) {
3317 if ( !
$title ->isJsSubpage() && !
$title ->isCssSubpage() ) {
3320 if ( !
$title ->isSubpageOf(
$user ->getUserPage() ) ) {
3325 $errors =
$title ->getUserPermissionsErrors(
'edit' ,
$user );
3326 if ( count( $errors ) !== 0 ) {
3345 'name' =>
'generator' ,
3346 'content' =>
"MediaWiki $wgVersion" ,
3349 if ( $config->get(
'ReferrerPolicy' ) !==
false ) {
3351 'name' =>
'referrer' ,
3352 'content' => $config->get(
'ReferrerPolicy' )
3356 $p =
"{$this->mIndexPolicy},{$this->mFollowPolicy}" ;
3357 if ( $p !==
'index,follow' ) {
3366 foreach ( $this->mMetatags
as $tag ) {
3367 if ( 0 == strcasecmp(
'http:' , substr( $tag[0], 0, 5 ) ) ) {
3369 $tag[0] = substr( $tag[0], 5 );
3373 $tagName =
"meta-{$tag[0]}" ;
3374 if ( isset( $tags[$tagName] ) ) {
3375 $tagName .= $tag[1];
3380 'content' => $tag[1]
3385 foreach ( $this->mLinktags
as $tag ) {
3389 # Universal edit button
3390 if ( $config->get(
'UniversalEditButton' ) && $this->
isArticleRelated () ) {
3393 && ( $this->
getTitle ()->exists() ||
3397 $msg = $this->
msg (
'edit' )->text();
3399 'rel' =>
'alternate' ,
3400 'type' =>
'application/x-wiki' ,
3402 'href' => $this->
getTitle ()->getEditURL(),
3408 'href' => $this->
getTitle ()->getEditURL(),
3413 # Generally the order of the favicon and apple-touch-icon links
3414 # should not matter, but Konqueror (3.5.9 at least) incorrectly
3415 # uses whichever one appears later in the HTML source. Make sure
3416 # apple-touch-icon is specified first to avoid this.
3417 if ( $config->get(
'AppleTouchIcon' ) !==
false ) {
3419 'rel' =>
'apple-touch-icon' ,
3420 'href' => $config->get(
'AppleTouchIcon' )
3424 if ( $config->get(
'Favicon' ) !==
false ) {
3426 'rel' =>
'shortcut icon' ,
3427 'href' => $config->get(
'Favicon' )
3431 # OpenSearch description link
3434 'type' =>
'application/opensearchdescription+xml' ,
3435 'href' =>
wfScript (
'opensearch_desc' ),
3436 'title' => $this->
msg (
'opensearch-desc' )->inContentLanguage()->
text (),
3439 if ( $config->get(
'EnableAPI' ) ) {
3440 # Real Simple Discovery link, provides auto-discovery information
3441 # for the MediaWiki API (and potentially additional custom API
3442 # support such as WordPress or Twitter-compatible APIs for a
3443 # blogging extension, etc)
3446 'type' =>
'application/rsd+xml' ,
3452 [
'action' =>
'rsd' ] ),
3459 if ( !$config->get(
'DisableLangConversion' ) ) {
3461 if (
$lang ->hasVariants() ) {
3462 $variants =
$lang ->getVariants();
3463 foreach ( $variants
as $variant ) {
3465 'rel' =>
'alternate' ,
3466 'hreflang' =>
wfBCP47 ( $variant ),
3467 'href' => $this->
getTitle ()->getLocalURL(
3468 [
'variant' => $variant ] )
3472 # x-default link per https://support.google.com/webmasters/answer/189077?hl=en
3474 'rel' =>
'alternate' ,
3475 'hreflang' =>
'x-default' ,
3476 'href' => $this->
getTitle ()->getLocalURL() ] );
3481 if ( $this->copyrightUrl !== null ) {
3485 if ( $config->get(
'RightsPage' ) ) {
3489 $copyright = $copy->getLocalURL();
3493 if ( !$copyright && $config->get(
'RightsUrl' ) ) {
3494 $copyright = $config->get(
'RightsUrl' );
3500 'rel' =>
'copyright' ,
3501 'href' => $copyright ]
3506 if ( $config->get(
'Feed' ) ) {
3510 # Use the page name for the title. In principle, this could
3511 # lead to issues with having the same name for different feeds
3512 # corresponding to the same page, but we can't avoid that at
3518 # Used
messages :
'page-rss-feed' and 'page-atom-feed' (
for an easier grep)
3520 "page-{$format}-feed" , $this->
getTitle ()->getPrefixedText()
3525 # Recent changes feed should appear on every page (except recentchanges,
3526 # that would be redundant). Put it after the per-page feed to avoid
3527 # changing existing behavior. It's still available, probably via a
3528 # menu in your browser. Some sites might have a different feed they'd
3529 # like to promote instead of the RC feed (maybe like a "Recent New Articles"
3530 # or "Breaking news" one). For this, we see if $wgOverrideSiteFeed is defined.
3531 # If so, use it instead.
3532 $sitename = $config->get(
'Sitename' );
3533 if ( $config->get(
'OverrideSiteFeed' ) ) {
3534 foreach ( $config->get(
'OverrideSiteFeed' )
as $type => $feedUrl ) {
3539 $this->
msg (
"site-{$type}-feed" , $sitename )->
text ()
3542 } elseif ( !$this->
getTitle ()->isSpecial(
'Recentchanges' ) ) {
3544 foreach ( $config->get(
'AdvertisedFeedTypes' )
as $format ) {
3547 $rctitle->getLocalURL( [
'feed' => $format ] ),
3548 # For grep: 'site-rss-feed', 'site-atom-feed'
3549 $this->
msg (
"site-{$format}-feed" , $sitename )->text()
3554 # Allow extensions to change the list pf feeds. This hook is primarily for changing,
3555 # manipulating or removing existing feed tags. If you want to add new feeds, you should
3556 # use OutputPage::addFeedLink() instead.
3557 Hooks::run (
'AfterBuildFeedLinks' , [ &$feedLinks ] );
3559 $tags += $feedLinks;
3563 if ( $config->get(
'EnableCanonicalServerLink' ) ) {
3564 if ( $canonicalUrl !==
false ) {
3576 if ( in_array( $action, [
'history' ,
'info' ] ) ) {
3577 $query =
"action={$action}" ;
3583 $reqUrl = $this->
getRequest ()->getRequestURL();
3588 if ( $canonicalUrl !==
false ) {
3590 'rel' =>
'canonical' ,
3591 'href' => $canonicalUrl
3618 'rel' =>
'alternate' ,
3619 'type' =>
"application/$type+xml" ,
3634 public function addStyle ( $style, $media =
'' , $condition =
'' ,
$dir =
'' ) {
3640 $options [
'condition' ] = $condition;
3656 if ( $flip ===
'flip' && $this->
getLanguage ()->isRTL() ) {
3657 # If wanted, and the interface is right-to-left, flip the CSS
3658 $style_css = CSSJanus::transform( $style_css,
true ,
false );
3672 $this->
getSkin ()->setupSkinUserCss( $this );
3690 $moduleStyles[] =
'site' ;
3691 $moduleStyles[] =
'noscript' ;
3692 $moduleStyles[] =
'user.groups' ;
3695 if ( $this->
getConfig ()->
get (
'AllowUserCss' ) && $this->
getTitle ()->isCssSubpage()
3701 [
'excludepage' => $this->
getTitle ()->getPrefixedDBkey() ]
3703 $otherTags = array_merge( $otherTags,
$link [
'html' ] );
3708 $previewedCSS = $this->
getRequest ()->getText(
'wpTextbox1' );
3709 if ( $this->
getLanguage ()->getDir() !== $wgContLang->getDir() ) {
3710 $previewedCSS = CSSJanus::transform( $previewedCSS,
true ,
false );
3715 $moduleStyles[] =
'user' ;
3719 $moduleStyles[] =
'user.cssprefs' ;
3721 foreach ( $moduleStyles
as $name ) {
3726 if ( $name ===
'site' ) {
3734 $group = $module->getGroup();
3757 [
'name' =>
'ResourceLoaderDynamicStyles' ,
'content' =>
'' ]
3763 foreach ( [
'site' ,
'noscript' ,
'private' ,
'user' ]
as $group ) {
3770 return self::getHtmlFromLoaderLinks( $links ) . implode(
'' , $otherTags );
3780 foreach ( $this->mExtStyles
as $url ) {
3783 $this->mExtStyles = [];
3785 foreach ( $this->styles
as $file =>
$options ) {
3788 $links[$file] =
$link ;
3802 if ( isset( $options[
'dir' ] ) ) {
3803 if ( $this->
getLanguage ()->getDir() != $options[
'dir' ] ) {
3808 if ( isset( $options[
'media' ] ) ) {
3809 $media = self::transformCssMedia( $options[
'media' ] );
3810 if ( is_null( $media ) ) {
3817 if ( substr( $style, 0, 1 ) ==
'/' ||
3818 substr( $style, 0, 5 ) ==
'http:' ||
3819 substr( $style, 0, 6 ) ==
'https:' ) {
3823 $url = $config->get(
'StylePath' ) .
'/' . $style .
'?' .
3824 $config->get(
'StyleVersion' );
3829 if ( isset( $options[
'condition' ] ) ) {
3830 $condition = htmlspecialchars( $options[
'condition' ] );
3831 $link =
"<!--[if $condition]>$link<![endif]-->" ;
3859 $remotePathPrefix = $config->
get (
'ResourceBasePath' );
3860 if ( $remotePathPrefix ===
'' ) {
3865 $remotePath = $remotePathPrefix;
3867 if ( strpos(
$path , $remotePath ) !== 0 ) {
3871 $path = RelPath\getRelativePath(
$path , $remotePath );
3872 return self::transformFilePath( $remotePathPrefix, $IP,
$path );
3887 $hash = md5_file(
"$localPath/$file" );
3888 if ( $hash ===
false ) {
3889 wfLogWarning ( __METHOD__ .
": Failed to hash $localPath/$file" );
3892 return "$remotePathPrefix/$file?" . substr( $hash, 0, 5 );
3906 $screenMediaQueryRegex =
'/^(?:only\s+)?screen\b/i' ;
3910 'printable' =>
'print' ,
3911 'handheld' =>
'handheld' ,
3913 foreach ( $switches
as $switch => $targetMedia ) {
3914 if ( $wgRequest->getBool( $switch ) ) {
3915 if ( $media == $targetMedia ) {
3917 } elseif ( preg_match( $screenMediaQueryRegex, $media ) === 1 ) {
3931 if ( $targetMedia ==
'print' || $media ==
'screen' ) {
3948 $args = func_get_args();
3991 $msgSpecs = func_get_args();
3992 array_shift( $msgSpecs );
3993 $msgSpecs = array_values( $msgSpecs );
3995 foreach ( $msgSpecs
as $n => $spec ) {
3996 if ( is_array( $spec ) ) {
3999 if ( isset(
$args [
'options' ] ) ) {
4000 unset(
$args [
'options' ] );
4002 'Adding "options" to ' . __METHOD__ .
' is no longer supported' ,
4021 $this->mEnableTOC = $flag;
4038 $this->mEnableSectionEditLinks = $flag;
4059 $themes = array_change_key_case( $themes, CASE_LOWER );
4060 $theme = isset( $themes[$skinName] ) ? $themes[$skinName] :
'MediaWiki' ;
4062 $themeClass =
"OOUI\\{$theme}Theme" ;
4063 OOUI\Theme::setSingleton(
new $themeClass() );
4064 OOUI\Element::setDefaultDir(
$dir );
4075 strtolower( $this->
getSkin ()->getSkinName() ),
4079 'oojs-ui-core.styles' ,
4080 'oojs-ui.styles.icons' ,
4081 'oojs-ui.styles.indicators' ,
4082 'oojs-ui.styles.textures' ,
4083 'mediawiki.widgets.styles' ,
4087 $this->
addMeta (
'X-OOUI-PHP' ,
'1' );
getPreventClickjacking()
Get the prevent-clickjacking flag.
setContext(IContextSource $context)
Set the IContextSource object.
addInlineStyle($style_css, $flip= 'noflip')
Adds inline CSS styles Internal use only.
const TS_RFC2822
RFC 2822 format, for E-mail and HTTP headers.
prependHTML($text)
Prepend $text to the body HTML.
isDisabled()
Return whether the output will be completely disabled.
static closeElement($element)
Returns "$element>".
showFileRenameError($old, $new)
static newFromContext(IContextSource $context)
Get a ParserOptions object from a IContextSource object.
ResourceLoader $mResourceLoader
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
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
Interface for objects which can provide a MediaWiki context on request.
wfGetDB($db, $groups=[], $wiki=false)
Get a Database object.
getPageTitleActionText()
Get the value of the "action text".
getMetadataAttribute()
Get the value of the "rel" attribute for metadata links.
getHeadItemsArray()
Get an array of head items.
static inlineScript($contents)
Output a "".
string null $mTarget
ResourceLoader target for load.php links.
getArticleBodyOnly()
Return whether the output will contain only the body of the article.
static makeConfigSetScript(array $configuration)
Returns JS code which will set the MediaWiki configuration array to the given value.
static escapeClass($class)
Given a value, escape it so that it can be used as a CSS class and return it.
addHelpLink($to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
filterModules(array $modules, $position=null, $type=ResourceLoaderModule::TYPE_COMBINED)
Filter an array of modules to remove insufficiently trustworthy members, and modules which are no lon...
string $mPageLinkTitle
Used by skin template.
addParserOutputContent($parserOutput)
Add the HTML and enhancements for it (like ResourceLoader modules) associated with a ParserOutput obj...
userCanPreview()
To make it harder for someone to slip a user a fake user-JavaScript or user-CSS preview, a random token is associated with the login session.
addParserOutputText($parserOutput)
Add the HTML associated with a ParserOutput object, without any metadata.
setPrintable()
Set the page as printable, i.e.
string null $copyrightUrl
The URL to send in a element with rel=copyright.
disable()
Disable output completely, i.e.
static exists($index)
Returns whether the specified namespace exists.
wfUrlencode($s)
We want some things to be included as literal characters in our title URLs for prettiness, which urlencode encodes by default.
setStatusCode($statusCode)
Set the HTTP status code to send with the output.
static newFromText($text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
this hook is for auditing only $response
Represents a title within MediaWiki.
addExtensionStyle($url)
Register and add a stylesheet from an extension directory.
static stripAllTags($text)
Take a fragment of (potentially invalid) HTML and return a version with any tags removed, encoded as plain text.
when a variable name is used in a it is silently declared as a new local masking the global
const ORIGIN_CORE_INDIVIDUAL
wfExpandUrl($url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
formatPermissionsErrorMessage(array $errors, $action=null)
Format a list of error messages.
string $mRevisionTimestamp
array $mLanguageLinks
Array of Interwiki Prefixed (non DB key) Titles (e.g.
getFileSearchOptions()
Get the files used on this page.
setCategoryLinks(array $categories)
Reset the category links (but not the category list) and add $categories.
isSyndicated()
Should we output feed links for this page?
array $styles
An array of stylesheet filenames (relative from skins path), with options for CSS media...
isPrintable()
Return whether the page is "printable".
getTitle()
Get the Title object.
prepareErrorPage($pageTitle, $htmlTitle=false)
Prepare this object to display an error page; disable caching and indexing, clear the current text an...
$mProperties
Additional key => value data.
get($name)
Get a configuration variable such as "Sitename" or "UploadMaintenance.".
getAllowedModules($type)
Show what level of JavaScript / CSS untrustworthiness is allowed on this page.
addElement($element, array $attribs=[], $contents= '')
Shortcut for adding an Html::element via addHTML.
array bool $mDoNothing
Whether output is disabled.
addModules($modules)
Add one or more modules recognized by ResourceLoader.
wfDebug($text, $dest= 'all', array $context=[])
Sends a line to the debug log if enabled or, optionally, to a comment in output.
reduceAllowedModules($type, $level)
Limit the highest level of CSS/JS untrustworthiness allowed.
setPageTitleActionText($text)
Set the new value of the "action text", this will be added to the "HTML title", separated from it wit...
bool $mPreventClickjacking
Controls if anti-clickjacking / frame-breaking headers will be sent.
addMetadataLink(array $linkarr)
Add a new \ with "rel" attribute set to "meta".
the value to return A Title object or null for latest to be modified or replaced by the hook handler or if authentication is not possible after cache objects are set for highlighting & $link
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
preventClickjacking($enable=true)
Set a flag which will cause an X-Frame-Options header appropriate for edit pages to be sent...
enableClientCache($state)
Use enableClientCache(false) to force it to send nocache headers.
getCategories()
Get the list of category names this page belongs to.
getJsConfigVars()
Get the javascript config vars to include on this page.
enableOOUI()
Add ResourceLoader module styles for OOUI and set up the PHP implementation of it for use with MediaW...
addParserOutput($parserOutput)
Add everything from a ParserOutput object.
bool $mPrintable
We have to set isPrintable().
static makeLoaderStateScript($name, $state=null)
Returns a JS call to mw.loader.state, which sets the state of a module or modules to a given value...
clearSubtitle()
Clear the subtitles.
Class representing a list of titles The execute() method checks them all for existence and adds them ...
wfTimestamp($outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
getRequest()
Get the WebRequest object.
addWikiTextWithTitle($text, &$title, $linestart=true)
Add wikitext with a custom Title object.
getHeadScripts()
JS stuff to put in the "".
bool $mIsArticleRelated
Stores "article flag" toggle.
canUseWikiPage()
Check whether a WikiPage object can be get with getWikiPage().
getExternalHeadScripts()
tags to put in "".
addTemplate(&$template)
Add the output of a QuickTemplate to the output buffer.
clearHTML()
Clear the body HTML.
getFrameOptions()
Get the X-Frame-Options header value (without the name part), or false if there isn't one...
A wrapper class which causes Xml::encodeJsVar() and Xml::encodeJsCall() to interpret a given string a...
setCdnMaxage($maxage)
Set the value of the "s-maxage" part of the "Cache-control" HTTP header.
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 after processing 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 unsetoffset-wrap String Wrap the message in html(usually something like"<
enableSectionEditLinks($flag=true)
Enables/disables section edit links, doesn't override NOEDITSECTION
getIndicators()
Get the indicators associated with this page.
getContext()
Get the base IContextSource object.
addWikiMsg()
Add a wikitext-formatted message to the output.
static makePackedModulesString($modules)
Convert an array of module names to a packed query string.
showNewSectionLink()
Show an "add new section" link?
Title $mRedirectedFrom
If the current page was reached through a redirect, $mRedirectedFrom contains the Title of the redire...
const ORIGIN_USER_SITEWIDE
and(b) You must cause any modified files to carry prominent notices stating that You changed the files
wfDeprecated($function, $version=false, $component=false, $callerOffset=2)
Throws a warning that $function is deprecated.
string $mHTMLtitle
Stores contents of "
" tag.
bool $mHideNewSectionLink
string $mBodytext
Contains all of the "" content.
static makeTitleSafe($ns, $title, $fragment= '', $interwiki= '')
Create a new Title from a namespace index and a DB key.
getModuleStyles($filter=false, $position=null)
Get the list of module CSS to include on this page.
parseInline($text, $linestart=true, $interface=false)
Parse wikitext, strip paragraphs, and return the HTML.
styleLink($style, array $options)
Generate \ tags for stylesheets.
static makeInlineScript($script)
Construct an inline script tag with given JS code.
$mETag
Contains an HTTP Entity Tags (see RFC 2616 section 3.13) which is used as a unique identifier for the...
getHtmlElementAttributes()
Return values for element.
wfBCP47($code)
Get the normalised IETF language tag See unit test for examples.
namespace and then decline to actually register it file or subcat img or subcat $title
static addModules(OutputPage $out)
Add ResourceLoader modules to the OutputPage object if debugging is enabled.
addLink(array $linkarr)
Add a new \ tag to the page header.
addStyle($style, $media= '', $condition= '', $dir= '')
Add a local or specified stylesheet, with the given media options.
static inlineStyle($contents, $media= 'all')
Output a "