break;
case 'revisionuser':
# Let the edit saving system know we should parse the page
- # *after* a revision ID has been assigned. This is for null edits.
- $this->mOutput->setFlag( 'vary-revision' );
- wfDebug( __METHOD__ . ": {{REVISIONUSER}} used, setting vary-revision...\n" );
+ # *after* a revision ID has been assigned for null edits.
+ $this->mOutput->setFlag( 'vary-user' );
+ wfDebug( __METHOD__ . ": {{REVISIONUSER}} used, setting vary-user...\n" );
$value = $this->getRevisionUser();
break;
case 'revisionsize':
- # Let the edit saving system know we should parse the page
- # *after* a revision ID has been assigned. This is for null edits.
- $this->mOutput->setFlag( 'vary-revision' );
- wfDebug( __METHOD__ . ": {{REVISIONSIZE}} used, setting vary-revision...\n" );
$value = $this->getRevisionSize();
break;
case 'namespace':
&& $this->mOptions->getAllowSpecialInclusion()
&& $this->ot['html']
) {
+ $specialPage = SpecialPageFactory::getPage( $title->getDBkey() );
// Pass the template arguments as URL parameters.
// "uselang" will have no effect since the Language object
// is forced to the one defined in ParserOptions.
$context = new RequestContext;
$context->setTitle( $title );
$context->setRequest( new FauxRequest( $pageArgs ) );
- $context->setUser( $this->getUser() );
+ if ( $specialPage && $specialPage->maxIncludeCacheTime() === 0 ) {
+ $context->setUser( $this->getUser() );
+ } else {
+ // If this page is cached, then we better not be per user.
+ $context->setUser( User::newFromName( '127.0.0.1', false ) );
+ }
$context->setLanguage( $this->mOptions->getUserLangObj() );
$ret = SpecialPageFactory::capturePath( $title, $context );
if ( $ret ) {
$this->mOutput->addOutputPageMetadata( $context->getOutput() );
$found = true;
$isHTML = true;
- $this->disableCache();
+ if ( $specialPage && $specialPage->maxIncludeCacheTime() !== false ) {
+ $this->mOutput->updateCacheExpiry( $specialPage->maxIncludeCacheTime() );
+ }
}
} elseif ( MWNamespace::isNonincludable( $title->getNamespace() ) ) {
$found = false; # access denied
# will change the size.
if ( $revObject ) {
$this->mRevisionSize = $revObject->getSize();
- } elseif ( $this->ot['wiki'] || $this->mOptions->getIsPreview() ) {
+ } else {
$this->mRevisionSize = $this->mInputSize;
}
}