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' ;
1314 # Add the remaining categories to the skin
1316 'OutputPageMakeCategoryLinks' ,
1317 [ &$this, $categories, &$this->mCategoryLinks ] )
1319 foreach ( $categories
as $category =>
$type ) {
1321 $category = (
string )$category;
1322 $origcategory = $category;
1327 $wgContLang->findVariantLink( $category,
$title ,
true );
1328 if ( $category != $origcategory && array_key_exists( $category, $categories ) ) {
1331 $text = $wgContLang->convertHtml(
$title ->getText() );
1332 $this->mCategories[] =
$title ->getText();
1344 $this->mCategoryLinks = [];
1381 ksort( $this->mIndicators );
1406 $text = $this->
msg (
'helppage-top-gethelp' )->escaped();
1408 if ( $overrideBaseUrl ) {
1411 $toUrlencoded =
wfUrlencode ( str_replace(
' ' ,
'_' , $to ) );
1412 $helpUrl =
"//www.mediawiki.org/wiki/Special:MyLanguage/$toUrlencoded" ;
1419 'target' =>
'_blank' ,
1420 'class' =>
'mw-helplink' ,
1444 if ( $this->
getConfig ()->
get (
'AllowSiteCSSOnRestrictedPages' ) ) {
1463 return min( array_values( $this->mAllowedModules ) );
1465 return isset( $this->mAllowedModules[
$type ] )
1466 ? $this->mAllowedModules[
$type ]
1499 $this->mBodytext .= $text;
1519 $this->mBodytext =
'' ;
1543 $anonPO->setEditSection(
false );
1544 if ( !
$options ->matches( $anonPO ) ) {
1550 if ( !$this->mParserOptions ) {
1556 $po->setEditSection(
false );
1557 $po->isBogus =
true ;
1565 $this->mParserOptions->setEditSection(
false );
1571 return wfSetVar ( $this->mParserOptions, null,
true );
1585 $val = is_null( $revid ) ? null : intval( $revid );
1586 return wfSetVar ( $this->mRevisionId, $val );
1627 if ( $file instanceof
File && $file->
exists () ) {
1628 $val = [
'time' => $file->getTimestamp(),
'sha1' => $file->getSha1() ];
1630 return wfSetVar ( $this->mFileVersion, $val,
true );
1671 public function addWikiText ( $text, $linestart =
true , $interface =
true ) {
1723 $tidy =
false , $interface =
false
1728 $oldTidy = $popts->setTidy( $tidy );
1729 $popts->setInterfaceMessage( (
bool )$interface );
1732 $text, $title, $popts,
1733 $linestart,
true , $this->mRevisionId
1736 $popts->setTidy( $oldTidy );
1766 $this->mHideNewSectionLink =
$parserOutput ->getHideNewSection();
1772 $this->mHeadItems = array_merge( $this->mHeadItems,
$parserOutput ->getHeadItems() );
1777 $this->mPreventClickjacking = $this->mPreventClickjacking
1782 if ( isset( $this->mTemplateIds[$ns] ) ) {
1783 $this->mTemplateIds[$ns] = $dbks + $this->mTemplateIds[$ns];
1785 $this->mTemplateIds[$ns] = $dbks;
1790 $this->mImageTimeKeys[$dbk] = $data;
1794 $parserOutputHooks = $this->
getConfig ()->get(
'ParserOutputHooks' );
1796 list ( $hookName, $data ) = $hookInfo;
1797 if ( isset( $parserOutputHooks[$hookName] ) ) {
1798 call_user_func( $parserOutputHooks[$hookName], $this,
$parserOutput , $data );
1810 Hooks::run (
'LanguageLinks' , [ $this->
getTitle (), &$this->mLanguageLinks, &$linkFlags ] );
1839 Hooks::run (
'OutputPageBeforeHTML' , [ &$this, &$text ] );
1854 $parserOutput ->setEditSectionTokens( $this->mEnableSectionEditLinks );
1881 public function parse ( $text, $linestart =
true , $interface =
false , $language = null ) {
1884 if ( is_null( $this->
getTitle () ) ) {
1885 throw new MWException (
'Empty $mTitle in ' . __METHOD__ );
1890 $popts->setInterfaceMessage(
true );
1892 if ( $language !== null ) {
1893 $oldLang = $popts->setTargetLanguage( $language );
1898 $linestart,
true , $this->mRevisionId
1902 $popts->setInterfaceMessage(
false );
1904 if ( $language !== null ) {
1905 $popts->setTargetLanguage( $oldLang );
1921 public function parseInline ( $text, $linestart =
true , $interface =
false ) {
1922 $parsed = $this->
parse ( $text, $linestart, $interface );
1940 $this->mCdnMaxage = min( $maxage, $this->mCdnMaxageLimit );
1950 $this->mCdnMaxageLimit = min( $maxage, $this->mCdnMaxageLimit );
1962 return wfSetVar ( $this->mEnableClientCache, $state );
1972 if ( $cookies === null ) {
1974 $cookies = array_merge(
1975 SessionManager::singleton()->getVaryCookies(),
1979 $config->get(
'CacheVaryCookies' )
1981 Hooks::run (
'GetCacheVaryCookies' , [ $this, &$cookies ] );
1995 if (
$request ->getCookie( $cookieName,
'' ,
'' ) !==
'' ) {
1996 wfDebug ( __METHOD__ .
": found $cookieName\n" );
2000 wfDebug ( __METHOD__ .
": no cache-varying cookies found\n" );
2013 if ( !array_key_exists( $header, $this->mVaryHeader ) ) {
2014 $this->mVaryHeader[$header] = [];
2016 if ( !is_array( $option ) ) {
2019 $this->mVaryHeader[$header] = array_unique( array_merge( $this->mVaryHeader[$header], $option ) );
2034 foreach ( SessionManager::singleton()->getVaryHeaders()
as $header =>
$options ) {
2037 return 'Vary: ' . implode(
', ' , array_keys( $this->mVaryHeader ) );
2048 $cookiesOption = [];
2049 foreach ( $cvCookies
as $cookieName ) {
2050 $cookiesOption[] =
'param=' . $cookieName;
2054 foreach ( SessionManager::singleton()->getVaryHeaders()
as $header =>
$options ) {
2059 foreach ( $this->mVaryHeader
as $header => $option ) {
2060 $newheader = $header;
2061 if ( is_array( $option ) && count( $option ) > 0 ) {
2062 $newheader .=
';' . implode(
';' , $option );
2064 $headers[] = $newheader;
2066 $key =
'Key: ' . implode(
',' , $headers );
2086 if ( !$this->
getRequest ()->getCheck(
'variant' ) &&
$lang ->hasVariants() ) {
2087 $variants =
$lang ->getVariants();
2089 foreach ( $variants
as $variant ) {
2090 if ( $variant ===
$lang ->getCode() ) {
2093 $aloption[] =
'substr=' . $variant;
2098 $variantBCP47 =
wfBCP47 ( $variant );
2099 if ( $variantBCP47 !== $variant ) {
2100 $aloption[] =
'substr=' . $variantBCP47;
2119 $this->mPreventClickjacking = $enable;
2128 $this->mPreventClickjacking =
false ;
2150 if ( $config->get(
'BreakFrames' ) ) {
2152 } elseif ( $this->mPreventClickjacking && $config->get(
'EditPageFrameOptions' ) ) {
2153 return $config->get(
'EditPageFrameOptions' );
2165 $response ->header(
"ETag: $this->mETag" );
2171 # don't serve compressed data to clients who can't handle it
2172 # maintain different caches for logged-in users and non-logged in ones
2175 if ( $config->get(
'UseKeyHeader' ) ) {
2179 if ( $this->mEnableClientCache ) {
2181 $config->get(
'UseSquid' ) &&
2183 !SessionManager::getGlobalSession()->isPersistent() &&
2185 $this->mCdnMaxage != 0 &&
2188 if ( $config->get(
'UseESI' ) ) {
2189 # We'll purge the proxy cache explicitly, but require end user agents
2190 # to revalidate against the proxy on each visit.
2191 # Surrogate-Control controls our CDN, Cache-Control downstream caches
2192 wfDebug ( __METHOD__ .
": proxy caching with ESI; {$this->mLastModified} **" ,
'private' );
2193 # start with a shorter timeout for initial testing
2194 # header( 'Surrogate-Control: max-age=2678400+2678400, content="ESI/1.0"');
2195 $response ->header(
'Surrogate-Control: max-age=' . $config->get(
'SquidMaxage' )
2196 .
'+' . $this->mCdnMaxage .
', content="ESI/1.0"' );
2197 $response ->header(
'Cache-Control: s-maxage=0, must-revalidate, max-age=0' );
2199 # We'll purge the proxy cache for anons explicitly, but require end user agents
2200 # to revalidate against the proxy on each visit.
2201 # IMPORTANT! The CDN needs to replace the Cache-Control header with
2202 # Cache-Control: s-maxage=0, must-revalidate, max-age=0
2203 wfDebug ( __METHOD__ .
": local proxy caching; {$this->mLastModified} **" ,
'private' );
2204 # start with a shorter timeout for initial testing
2205 # header( "Cache-Control: s-maxage=2678400, must-revalidate, max-age=0" );
2206 $response ->header(
'Cache-Control: s-maxage=' . $this->mCdnMaxage
2207 .
', must-revalidate, max-age=0' );
2210 # We do want clients to cache if they can, but they *must* check for updates
2211 # on revisiting the page.
2212 wfDebug ( __METHOD__ .
": private caching; {$this->mLastModified} **" ,
'private' );
2213 $response ->header(
'Expires: ' . gmdate(
'D, d M Y H:i:s' , 0 ) .
' GMT' );
2214 $response ->header(
"Cache-Control: private, must-revalidate, max-age=0" );
2216 if ( $this->mLastModified ) {
2217 $response ->header(
"Last-Modified: {$this->mLastModified}" );
2220 wfDebug ( __METHOD__ .
": no caching **" ,
'private' );
2222 # In general, the absence of a last modified header should be enough to prevent
2223 # the client from using its cache. We send a few other things just to make sure.
2224 $response ->header(
'Expires: ' . gmdate(
'D, d M Y H:i:s' , 0 ) .
' GMT' );
2225 $response ->header(
'Cache-Control: no-cache, no-store, max-age=0, must-revalidate' );
2226 $response ->header(
'Pragma: no-cache' );
2235 if ( $this->mDoNothing ) {
2242 if ( $this->mRedirect !=
'' ) {
2243 # Standards require redirect URLs to be absolute
2249 if (
Hooks::run (
"BeforePageRedirect" , [ $this, &$redirect, &
$code ] ) ) {
2251 if ( !$config->get(
'DebugRedirects' ) ) {
2256 if ( $config->get(
'VaryOnXFP' ) ) {
2261 $response ->header(
"Content-Type: text/html; charset=utf-8" );
2262 if ( $config->get(
'DebugRedirects' ) ) {
2263 $url = htmlspecialchars( $redirect );
2264 print "<html>\n<head>\n<title>Redirect</title>\n</head>\n<body>\n" ;
2265 print "<p>Location: <a href=\"$url\">$url</a></p>\n" ;
2266 print "</body>\n</html>\n" ;
2268 $response ->header(
'Location: ' . $redirect );
2273 } elseif ( $this->mStatusCode ) {
2274 $response ->statusHeader( $this->mStatusCode );
2277 # Buffer output; final headers may depend on later processing
2280 $response ->header(
'Content-type: ' . $config->get(
'MimeType' ) .
'; charset=UTF-8' );
2281 $response ->header(
'Content-language: ' . $config->get(
'LanguageCode' ) );
2285 $response ->header(
'X-UA-Compatible: IE=Edge' );
2289 if ( $frameOptions ) {
2290 $response ->header(
"X-Frame-Options: $frameOptions" );
2293 if ( $this->mArticleBodyOnly ) {
2298 $modules = $sk->getDefaultModules();
2304 'mediawiki.page.startup' ,
2309 if ( $config->get(
'ResponsiveImages' ) ) {
2310 $coreModules[] =
'mediawiki.hidpi' ;
2314 foreach ( $modules
as $group ) {
2321 Hooks::run (
'BeforePageDisplay' , [ &$this, &$sk ] );
2333 Hooks::run (
'AfterFinalPageOutput' , [ $this ] );
2357 if ( $htmlTitle !==
false ) {
2363 $this->mRedirect =
'' ;
2387 if ( $msg instanceof Message ) {
2389 trigger_error(
'Argument ignored: $params. The message parameters argument '
2390 .
'is discarded when the $msg argument is a Message object instead of '
2391 .
'a string.' , E_USER_NOTICE );
2393 $this->
addHTML ( $msg->parseAsBlock() );
2413 if ( in_array( $action, [
'read' ,
'edit' ,
'createpage' ,
'createtalk' ,
'upload' ] )
2414 && $this->
getUser ()->isAnon() && count( $errors ) == 1 && isset( $errors[0][0] )
2415 && ( $errors[0][0] ==
'badaccess-groups' || $errors[0][0] ==
'badaccess-group0' )
2419 $displayReturnto = null;
2421 # Due to bug 32276, if a user does not have read permissions,
2422 # $this->getTitle() will just give Special:Badtitle, which is
2423 # not especially useful as a returnto parameter. Use the title
2424 # from the request instead, if there was one.
2427 if ( $action ==
'edit' ) {
2428 $msg =
'whitelistedittext' ;
2429 $displayReturnto = $returnto;
2430 } elseif ( $action ==
'createpage' || $action ==
'createtalk' ) {
2431 $msg =
'nocreatetext' ;
2432 } elseif ( $action ==
'upload' ) {
2433 $msg =
'uploadnologintext' ;
2435 $msg =
'loginreqpagetext' ;
2442 $query [
'returnto' ] = $returnto->getPrefixedText();
2445 $returntoquery =
$request ->getValues();
2446 unset( $returntoquery[
'title' ] );
2447 unset( $returntoquery[
'returnto' ] );
2448 unset( $returntoquery[
'returntoquery' ] );
2454 $this->
msg (
'loginreqlink' )->escaped(),
2460 $this->
addHTML ( $this->
msg ( $msg )->rawParams( $loginLink )->
parse () );
2462 # Don't return to a page the user can't read otherwise
2463 # we'll end up in a pointless loop
2464 if ( $displayReturnto && $displayReturnto->userCan(
'read' , $this->getUser() ) ) {
2494 if ( $action == null ) {
2495 $text = $this->
msg (
'permissionserrorstext' , count( $errors ) )->plain() .
"\n\n" ;
2497 $action_desc = $this->
msg (
"action-$action" )->plain();
2499 'permissionserrorstext-withaction' ,
2502 )->plain() .
"\n\n" ;
2505 if ( count( $errors ) > 1 ) {
2506 $text .=
'<ul class="permissions-errors">' .
"\n" ;
2508 foreach ( $errors
as $error ) {
2510 $text .= call_user_func_array( [ $this,
'msg' ], $error )->plain();
2515 $text .=
"<div class=\"permissions-errors\">\n" .
2516 call_user_func_array( [ $this,
'msg' ], reset( $errors ) )->plain() .
2535 if ( func_num_args() > 0 ) {
2536 throw new MWException ( __METHOD__ .
' no longer accepts arguments since 1.25.' );
2564 if ( $lag >= $config->get(
'SlaveLagWarning' ) ) {
2565 $message = $lag < $config->get(
'SlaveLagCritical' )
2568 $wrap =
Html::rawElement (
'div' , [
'class' =>
"mw-{$message}" ],
"\n$1\n" );
2608 $link = $this->
msg (
'returnto' )->rawParams(
2610 $this->
addHTML (
"<p id=\"mw-returnto\">{$link}</p>\n" );
2621 public function returnToMain ( $unused = null, $returnto = null, $returntoquery = null ) {
2622 if ( $returnto == null ) {
2623 $returnto = $this->
getRequest ()->getText(
'returnto' );
2626 if ( $returntoquery == null ) {
2627 $returntoquery = $this->
getRequest ()->getText(
'returntoquery' );
2630 if ( $returnto ===
'' ) {
2634 if ( is_object( $returnto ) ) {
2635 $titleObj = $returnto;
2639 if ( !is_object( $titleObj ) ) {
2655 $sitedir = $wgContLang->getDir();
2665 # Don't bother with the newline if $head == ''
2666 $ret .=
"$openHead\n" ;
2687 $ret .= $item .
"\n" ;
2690 foreach ( $this->mHeadItems
as $item ) {
2691 $ret .= $item .
"\n" ;
2696 $ret .=
"$closeHead\n" ;
2700 $bodyClasses[] =
'mediawiki' ;
2702 # Classes for LTR/RTL directionality support
2703 $bodyClasses[] = $userdir;
2704 $bodyClasses[] =
"sitedir-$sitedir" ;
2706 if ( $this->
getLanguage ()->capitalizeAllNouns() ) {
2707 # A <body> class is probably not the best way to do this . . .
2708 $bodyClasses[] =
'capitalize-all-nouns' ;
2719 $bodyAttrs[
'class' ] = implode(
' ' , $bodyClasses );
2723 Hooks::run (
'OutputPageBodyAttributes' , [ $this, $sk, &$bodyAttrs ] );
2736 if ( is_null( $this->mResourceLoader ) ) {
2739 LoggerFactory::getInstance(
'resourceloader' )
2756 $modules = (
array )$modules;
2765 if ( !count( $modules ) ) {
2769 if ( count( $modules ) > 1 ) {
2771 $modules = array_unique( $modules );
2777 foreach ( $modules
as $name ) {
2779 $links[
'html' ] = array_merge( $links[
'html' ],
$link [
'html' ] );
2780 $links[
'states' ] +=
$link [
'states' ];
2786 if ( !is_null( $this->mTarget ) ) {
2791 $sortedModules = [];
2793 foreach ( $modules
as $name ) {
2795 # Check that we're allowed to include this module on this page
2803 || ( $this->mTarget && !in_array( $this->mTarget, $module->getTargets() ) )
2808 $sortedModules[$module->getSource()][$module->getGroup()][
$name ] = $module;
2811 foreach ( $sortedModules
as $source => $groups ) {
2812 foreach ( $groups
as $group => $grpModules ) {
2815 if ( ( $group ===
'user' || $group ===
'private' ) && $this->
getUser ()->isLoggedIn() ) {
2824 $this->
getSkin ()->getSkinName(),
2838 foreach ( $grpModules
as $key => $module ) {
2841 if ( $module->isKnownEmpty(
$context ) ) {
2842 unset( $grpModules[
$key ] );
2844 $links[
'states' ][
$key ] =
'ready' ;
2848 $isRaw |= $module->isRaw();
2852 if ( count( $grpModules ) === 0 ) {
2860 if ( $group ===
'private' ) {
2879 if ( $group ===
'user' ) {
2891 if (
$context ->getRaw() || $isRaw ) {
2895 'async' => !isset( $extraQuery[
'sync' ] ),
2906 foreach ( $grpModules
as $key => $module ) {
2908 if (
$key !==
'startup' ) {
2909 $links[
'states' ][
$key ] =
'loading' ;
2914 if ( $group ==
'noscript' ) {
2917 $links[
'html' ][] =
$link ;
2934 if ( !is_array( $link ) ) {
2938 $states += $link[
'states' ];
2944 if ( count( $states ) ) {
2950 return WrappedString::join(
"\n" ,
$html );
2976 return self::getHtmlFromLoaderLinks( $links );
2994 'document.documentElement.className = document.documentElement.className'
2995 .
'.replace( /(^|\s)client-nojs(\s|$)/, "$1client-js$2" );'
3006 $embedScripts = [
'user.options' ];
3032 return self::getHtmlFromLoaderLinks( $links );
3055 $modules = $this->
getModules (
true ,
'bottom' );
3068 if ( $this->
getConfig ()->
get (
'AllowUserJs' )
3070 && $this->
getTitle ()->isJsSubpage()
3076 [
'excludepage' => $this->
getTitle ()->getPrefixedDBkey() ]
3109 return self::getHtmlFromLoaderLinks( $links );
3137 if ( is_array(
$keys ) ) {
3161 $canonicalSpecialPageName =
false ; # bug 21115
3164 $ns = $title->getNamespace();
3167 : $title->getNsText();
3172 $relevantTitle = $sk->getRelevantTitle();
3173 $relevantUser = $sk->getRelevantUser();
3176 list ( $canonicalSpecialPageName, ) =
3180 $curRevisionId = $wikiPage->getLatest();
3181 $articleId = $wikiPage->getId();
3184 $lang = $title->getPageViewLanguage();
3187 $separatorTransTable =
$lang ->separatorTransformTable();
3188 $separatorTransTable = $separatorTransTable ? $separatorTransTable : [];
3189 $compactSeparatorTransTable = [
3190 implode(
"\t" , array_keys( $separatorTransTable ) ),
3191 implode(
"\t" , $separatorTransTable ),
3193 $digitTransTable =
$lang ->digitTransformTable();
3194 $digitTransTable = $digitTransTable ? $digitTransTable : [];
3195 $compactDigitTransTable = [
3196 implode(
"\t" , array_keys( $digitTransTable ) ),
3197 implode(
"\t" , $digitTransTable ),
3203 'wgCanonicalNamespace' => $canonicalNamespace,
3204 'wgCanonicalSpecialPageName' => $canonicalSpecialPageName,
3205 'wgNamespaceNumber' => $title->getNamespace(),
3206 'wgPageName' => $title->getPrefixedDBkey(),
3207 'wgTitle' => $title->getText(),
3208 'wgCurRevisionId' => $curRevisionId,
3210 'wgArticleId' => $articleId,
3212 'wgIsRedirect' => $title->isRedirect(),
3214 'wgUserName' =>
$user ->isAnon() ? null :
$user ->getName(),
3215 'wgUserGroups' =>
$user ->getEffectiveGroups(),
3218 'wgPageContentLanguage' =>
$lang ->getCode(),
3219 'wgPageContentModel' => $title->getContentModel(),
3220 'wgSeparatorTransformTable' => $compactSeparatorTransTable,
3221 'wgDigitTransformTable' => $compactDigitTransTable,
3222 'wgDefaultDateFormat' =>
$lang ->getDefaultDateFormat(),
3223 'wgMonthNames' =>
$lang ->getMonthNamesArray(),
3224 'wgMonthNamesShort' =>
$lang ->getMonthAbbreviationsArray(),
3225 'wgRelevantPageName' => $relevantTitle->getPrefixedDBkey(),
3226 'wgRelevantArticleId' => $relevantTitle->getArticleID(),
3230 if (
$user ->isLoggedIn() ) {
3232 $vars [
'wgUserEditCount' ] =
$user ->getEditCount();
3234 $vars [
'wgUserRegistration' ] = $userReg !== null ? ( $userReg * 1000 ) : null;
3238 $vars[
'wgUserNewMsgRevisionId' ] =
$user ->getNewMessageRevisionId();
3241 if ( $wgContLang->hasVariants() ) {
3242 $vars [
'wgUserVariant' ] = $wgContLang->getPreferredVariant();
3245 $vars [
'wgIsProbablyEditable' ] = $title->quickUserCan(
'edit' ,
$user )
3246 && ( $title->exists() || $title->quickUserCan(
'create' ,
$user ) );
3248 foreach ( $title->getRestrictionTypes()
as $type ) {
3249 $vars [
'wgRestriction' . ucfirst(
$type )] = $title->getRestrictions(
$type );
3252 if ( $title->isMainPage() ) {
3253 $vars [
'wgIsMainPage' ] =
true ;
3256 if ( $this->mRedirectedFrom ) {
3257 $vars [
'wgRedirectedFrom' ] = $this->mRedirectedFrom->getPrefixedDBkey();
3260 if ( $relevantUser ) {
3261 $vars [
'wgRelevantUserName' ] = $relevantUser->getName();
3286 $request ->getVal(
'action' ) !==
'submit' ||
3287 !
$request ->getCheck(
'wpPreview' ) ||
3295 if ( !$this->
getUser ()->isLoggedIn() ) {
3299 if ( !
$user ->matchEditToken(
$request ->getVal(
'wpEditToken' ) ) ) {
3304 if ( !
$title ->isJsSubpage() && !
$title ->isCssSubpage() ) {
3307 if ( !
$title ->isSubpageOf(
$user ->getUserPage() ) ) {
3312 $errors =
$title ->getUserPermissionsErrors(
'edit' ,
$user );
3313 if ( count( $errors ) !== 0 ) {
3332 'name' =>
'generator' ,
3333 'content' =>
"MediaWiki $wgVersion" ,
3336 if ( $config->get(
'ReferrerPolicy' ) !==
false ) {
3338 'name' =>
'referrer' ,
3339 'content' => $config->get(
'ReferrerPolicy' )
3343 $p =
"{$this->mIndexPolicy},{$this->mFollowPolicy}" ;
3344 if ( $p !==
'index,follow' ) {
3353 foreach ( $this->mMetatags
as $tag ) {
3354 if ( 0 == strcasecmp(
'http:' , substr( $tag[0], 0, 5 ) ) ) {
3356 $tag[0] = substr( $tag[0], 5 );
3360 $tagName =
"meta-{$tag[0]}" ;
3361 if ( isset( $tags[$tagName] ) ) {
3362 $tagName .= $tag[1];
3367 'content' => $tag[1]
3372 foreach ( $this->mLinktags
as $tag ) {
3376 # Universal edit button
3377 if ( $config->get(
'UniversalEditButton' ) && $this->
isArticleRelated () ) {
3380 && ( $this->
getTitle ()->exists() ||
3384 $msg = $this->
msg (
'edit' )->text();
3386 'rel' =>
'alternate' ,
3387 'type' =>
'application/x-wiki' ,
3389 'href' => $this->
getTitle ()->getEditURL(),
3395 'href' => $this->
getTitle ()->getEditURL(),
3400 # Generally the order of the favicon and apple-touch-icon links
3401 # should not matter, but Konqueror (3.5.9 at least) incorrectly
3402 # uses whichever one appears later in the HTML source. Make sure
3403 # apple-touch-icon is specified first to avoid this.
3404 if ( $config->get(
'AppleTouchIcon' ) !==
false ) {
3406 'rel' =>
'apple-touch-icon' ,
3407 'href' => $config->get(
'AppleTouchIcon' )
3411 if ( $config->get(
'Favicon' ) !==
false ) {
3413 'rel' =>
'shortcut icon' ,
3414 'href' => $config->get(
'Favicon' )
3418 # OpenSearch description link
3421 'type' =>
'application/opensearchdescription+xml' ,
3422 'href' =>
wfScript (
'opensearch_desc' ),
3423 'title' => $this->
msg (
'opensearch-desc' )->inContentLanguage()->
text (),
3426 if ( $config->get(
'EnableAPI' ) ) {
3427 # Real Simple Discovery link, provides auto-discovery information
3428 # for the MediaWiki API (and potentially additional custom API
3429 # support such as WordPress or Twitter-compatible APIs for a
3430 # blogging extension, etc)
3433 'type' =>
'application/rsd+xml' ,
3439 [
'action' =>
'rsd' ] ),
3446 if ( !$config->get(
'DisableLangConversion' ) ) {
3448 if (
$lang ->hasVariants() ) {
3449 $variants =
$lang ->getVariants();
3450 foreach ( $variants
as $variant ) {
3452 'rel' =>
'alternate' ,
3453 'hreflang' =>
wfBCP47 ( $variant ),
3454 'href' => $this->
getTitle ()->getLocalURL(
3455 [
'variant' => $variant ] )
3459 # x-default link per https://support.google.com/webmasters/answer/189077?hl=en
3461 'rel' =>
'alternate' ,
3462 'hreflang' =>
'x-default' ,
3463 'href' => $this->
getTitle ()->getLocalURL() ] );
3468 if ( $this->copyrightUrl !== null ) {
3472 if ( $config->get(
'RightsPage' ) ) {
3476 $copyright = $copy->getLocalURL();
3480 if ( !$copyright && $config->get(
'RightsUrl' ) ) {
3481 $copyright = $config->get(
'RightsUrl' );
3487 'rel' =>
'copyright' ,
3488 'href' => $copyright ]
3493 if ( $config->get(
'Feed' ) ) {
3497 # Use the page name for the title. In principle, this could
3498 # lead to issues with having the same name for different feeds
3499 # corresponding to the same page, but we can't avoid that at
3505 # Used
messages :
'page-rss-feed' and 'page-atom-feed' (
for an easier grep)
3507 "page-{$format}-feed" , $this->
getTitle ()->getPrefixedText()
3512 # Recent changes feed should appear on every page (except recentchanges,
3513 # that would be redundant). Put it after the per-page feed to avoid
3514 # changing existing behavior. It's still available, probably via a
3515 # menu in your browser. Some sites might have a different feed they'd
3516 # like to promote instead of the RC feed (maybe like a "Recent New Articles"
3517 # or "Breaking news" one). For this, we see if $wgOverrideSiteFeed is defined.
3518 # If so, use it instead.
3519 $sitename = $config->get(
'Sitename' );
3520 if ( $config->get(
'OverrideSiteFeed' ) ) {
3521 foreach ( $config->get(
'OverrideSiteFeed' )
as $type => $feedUrl ) {
3526 $this->
msg (
"site-{$type}-feed" , $sitename )->
text ()
3529 } elseif ( !$this->
getTitle ()->isSpecial(
'Recentchanges' ) ) {
3531 foreach ( $config->get(
'AdvertisedFeedTypes' )
as $format ) {
3534 $rctitle->getLocalURL( [
'feed' => $format ] ),
3535 # For grep: 'site-rss-feed', 'site-atom-feed'
3536 $this->
msg (
"site-{$format}-feed" , $sitename )->text()
3541 # Allow extensions to change the list pf feeds. This hook is primarily for changing,
3542 # manipulating or removing existing feed tags. If you want to add new feeds, you should
3543 # use OutputPage::addFeedLink() instead.
3544 Hooks::run (
'AfterBuildFeedLinks' , [ &$feedLinks ] );
3546 $tags += $feedLinks;
3550 if ( $config->get(
'EnableCanonicalServerLink' ) ) {
3551 if ( $canonicalUrl !==
false ) {
3563 if ( in_array( $action, [
'history' ,
'info' ] ) ) {
3564 $query =
"action={$action}" ;
3570 $reqUrl = $this->
getRequest ()->getRequestURL();
3575 if ( $canonicalUrl !==
false ) {
3577 'rel' =>
'canonical' ,
3578 'href' => $canonicalUrl
3605 'rel' =>
'alternate' ,
3606 'type' =>
"application/$type+xml" ,
3621 public function addStyle ( $style, $media =
'' , $condition =
'' ,
$dir =
'' ) {
3627 $options [
'condition' ] = $condition;
3643 if ( $flip ===
'flip' && $this->
getLanguage ()->isRTL() ) {
3644 # If wanted, and the interface is right-to-left, flip the CSS
3645 $style_css = CSSJanus::transform( $style_css,
true ,
false );
3659 $this->
getSkin ()->setupSkinUserCss( $this );
3677 $moduleStyles[] =
'site' ;
3678 $moduleStyles[] =
'noscript' ;
3679 $moduleStyles[] =
'user.groups' ;
3682 if ( $this->
getConfig ()->
get (
'AllowUserCss' ) && $this->
getTitle ()->isCssSubpage()
3688 [
'excludepage' => $this->
getTitle ()->getPrefixedDBkey() ]
3690 $otherTags = array_merge( $otherTags,
$link [
'html' ] );
3695 $previewedCSS = $this->
getRequest ()->getText(
'wpTextbox1' );
3696 if ( $this->
getLanguage ()->getDir() !== $wgContLang->getDir() ) {
3697 $previewedCSS = CSSJanus::transform( $previewedCSS,
true ,
false );
3702 $moduleStyles[] =
'user' ;
3706 $moduleStyles[] =
'user.cssprefs' ;
3708 foreach ( $moduleStyles
as $name ) {
3713 if ( $name ===
'site' ) {
3721 $group = $module->getGroup();
3744 [
'name' =>
'ResourceLoaderDynamicStyles' ,
'content' =>
'' ]
3750 foreach ( [
'site' ,
'noscript' ,
'private' ,
'user' ]
as $group ) {
3757 return self::getHtmlFromLoaderLinks( $links ) . implode(
'' , $otherTags );
3767 foreach ( $this->mExtStyles
as $url ) {
3770 $this->mExtStyles = [];
3772 foreach ( $this->styles
as $file =>
$options ) {
3775 $links[$file] =
$link ;
3789 if ( isset( $options[
'dir' ] ) ) {
3790 if ( $this->
getLanguage ()->getDir() != $options[
'dir' ] ) {
3795 if ( isset( $options[
'media' ] ) ) {
3796 $media = self::transformCssMedia( $options[
'media' ] );
3797 if ( is_null( $media ) ) {
3804 if ( substr( $style, 0, 1 ) ==
'/' ||
3805 substr( $style, 0, 5 ) ==
'http:' ||
3806 substr( $style, 0, 6 ) ==
'https:' ) {
3810 $url = $config->get(
'StylePath' ) .
'/' . $style .
'?' .
3811 $config->get(
'StyleVersion' );
3816 if ( isset( $options[
'condition' ] ) ) {
3817 $condition = htmlspecialchars( $options[
'condition' ] );
3818 $link =
"<!--[if $condition]>$link<![endif]-->" ;
3846 $remotePathPrefix = $config->
get (
'ResourceBasePath' );
3847 if ( $remotePathPrefix ===
'' ) {
3852 $remotePath = $remotePathPrefix;
3854 if ( strpos(
$path , $remotePath ) !== 0 ) {
3858 $path = RelPath\getRelativePath(
$path , $remotePath );
3859 return self::transformFilePath( $remotePathPrefix, $IP,
$path );
3874 $hash = md5_file(
"$localPath/$file" );
3875 if ( $hash ===
false ) {
3876 wfLogWarning ( __METHOD__ .
": Failed to hash $localPath/$file" );
3879 return "$remotePathPrefix/$file?" . substr( $hash, 0, 5 );
3893 $screenMediaQueryRegex =
'/^(?:only\s+)?screen\b/i' ;
3897 'printable' =>
'print' ,
3898 'handheld' =>
'handheld' ,
3900 foreach ( $switches
as $switch => $targetMedia ) {
3901 if ( $wgRequest->getBool( $switch ) ) {
3902 if ( $media == $targetMedia ) {
3904 } elseif ( preg_match( $screenMediaQueryRegex, $media ) === 1 ) {
3918 if ( $targetMedia ==
'print' || $media ==
'screen' ) {
3935 $args = func_get_args();
3978 $msgSpecs = func_get_args();
3979 array_shift( $msgSpecs );
3980 $msgSpecs = array_values( $msgSpecs );
3982 foreach ( $msgSpecs
as $n => $spec ) {
3983 if ( is_array( $spec ) ) {
3986 if ( isset(
$args [
'options' ] ) ) {
3987 unset(
$args [
'options' ] );
3989 'Adding "options" to ' . __METHOD__ .
' is no longer supported' ,
4008 $this->mEnableTOC = $flag;
4025 $this->mEnableSectionEditLinks = $flag;
4046 $themes = array_change_key_case( $themes, CASE_LOWER );
4047 $theme = isset( $themes[$skinName] ) ? $themes[$skinName] :
'MediaWiki' ;
4049 $themeClass =
"OOUI\\{$theme}Theme" ;
4050 OOUI\Theme::setSingleton(
new $themeClass() );
4051 OOUI\Element::setDefaultDir(
$dir );
4062 strtolower( $this->
getSkin ()->getSkinName() ),
4066 'oojs-ui-core.styles' ,
4067 'oojs-ui.styles.icons' ,
4068 'oojs-ui.styles.indicators' ,
4069 'oojs-ui.styles.textures' ,
4070 'mediawiki.widgets.styles' ,
4074 $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 "