* @return string Return the text of this revision
*/
public function getContent() {
- ContentHandler::deprecated( __METHOD__, '1.21' );
+ wfDeprecated( __METHOD__, '1.21' );
$content = $this->getContentObject();
return ContentHandler::getContentText( $content );
}
// @todo Get rid of mContent everywhere!
$this->mContent = ContentHandler::getContentText( $content );
- ContentHandler::runLegacyHooks( 'ArticleAfterFetchContent', [ &$this, &$this->mContent ] );
+ ContentHandler::runLegacyHooks(
+ 'ArticleAfterFetchContent',
+ [ &$this, &$this->mContent ],
+ '1.21'
+ );
return $this->mContent;
}
$this->mContentObject = $content;
$this->mRevIdFetched = $this->mRevision->getId();
- Hooks::run( 'ArticleAfterFetchContentObject', [ &$this, &$this->mContentObject ] );
+ ContentHandler::runLegacyHooks(
+ 'ArticleAfterFetchContentObject',
+ [ &$this, &$this->mContentObject ],
+ '1.21'
+ );
return $this->mContentObject;
}
# Allow extensions do their own custom view for certain pages
$outputDone = true;
- } elseif ( !ContentHandler::runLegacyHooks( 'ArticleViewCustom',
- [ $this->fetchContentObject(), $this->getTitle(), $outputPage ] ) ) {
-
+ } elseif ( !ContentHandler::runLegacyHooks(
+ 'ArticleViewCustom',
+ [ $this->fetchContentObject(), $this->getTitle(), $outputPage ],
+ '1.21'
+ ) ) {
# Allow extensions do their own custom view for certain pages
$outputDone = true;
}
}
}
+ # Use adaptive TTLs for CDN so delayed/failed purges are noticed less often.
+ # This could use getTouched(), but that could be scary for major template edits.
+ $outputPage->adaptCdnTTL( $this->mPage->getTimestamp(), IExpiringStore::TTL_DAY );
+
# Check for any __NOINDEX__ tags on the page using $pOutput
$policy = $this->getRobotPolicy( 'view', $pOutput );
$outputPage->setIndexPolicy( $policy['index'] );
$this->mPage->doViewUpdates( $user, $oldid );
$outputPage->addModules( 'mediawiki.action.view.postEdit' );
-
}
/**
// Give hooks a chance to customise the output
if ( ContentHandler::runLegacyHooks(
'ShowRawCssJs',
- [ $this->mContentObject, $this->getTitle(), $outputPage ] )
- ) {
+ [ $this->mContentObject, $this->getTitle(), $outputPage ],
+ '1.24'
+ ) ) {
// If no legacy hooks ran, display the content of the parser output, including RL modules,
// but excluding metadata like categories and language links
$po = $this->mContentObject->getParserOutput( $this->getTitle() );
return false;
}
- $rcid = $rc->getAttribute( 'rc_id' );
-
- $token = $user->getEditToken( $rcid );
-
$outputPage->preventClickjacking();
if ( $wgEnableAPI && $wgEnableWriteAPI && $user->isAllowed( 'writeapi' ) ) {
$outputPage->addModules( 'mediawiki.page.patrol.ajax' );
[],
[
'action' => 'markpatrolled',
- 'rcid' => $rcid,
- 'token' => $token,
+ 'rcid' => $rc->getAttribute( 'rc_id' ),
]
);
/**
* Call to WikiPage function for backwards compatibility.
+ * @deprecated since 1.21, use prepareContentForEdit
* @see WikiPage::prepareTextForEdit
*/
public function prepareTextForEdit( $text, $revid = null, User $user = null ) {