X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fpage%2FArticle.php;h=9a2a8e2b577d597495b22dff23f6802b89433fd5;hb=da77d316ba5915028b881f49dcefb40947351b7d;hp=338b1aeb89a6ae1d7c30710b4ec7a8f125ddf00c;hpb=b77025f04552d4a35f1b66fa8d5aa14c7e7c038d;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/page/Article.php b/includes/page/Article.php index 338b1aeb89..9a2a8e2b57 100644 --- a/includes/page/Article.php +++ b/includes/page/Article.php @@ -210,7 +210,7 @@ class Article implements Page { * @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 ); } @@ -347,7 +347,11 @@ class Article implements Page { // @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; } @@ -424,7 +428,11 @@ class Article implements Page { $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; } @@ -623,9 +631,11 @@ class Article implements Page { # 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; } @@ -696,6 +706,10 @@ class Article implements Page { } } + # 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'] ); @@ -705,7 +719,6 @@ class Article implements Page { $this->mPage->doViewUpdates( $user, $oldid ); $outputPage->addModules( 'mediawiki.action.view.postEdit' ); - } /** @@ -798,8 +811,9 @@ class Article implements Page { // 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() ); @@ -1170,10 +1184,6 @@ class Article implements Page { 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' ); @@ -1185,8 +1195,7 @@ class Article implements Page { [], [ 'action' => 'markpatrolled', - 'rcid' => $rcid, - 'token' => $token, + 'rcid' => $rc->getAttribute( 'rc_id' ), ] ); @@ -2496,6 +2505,7 @@ class Article implements Page { /** * 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 ) {