* here, there doesn't seem to be any other way to stop calling
* OutputPage::enableSectionEditLinks() and still have it work as it did before.
*/
- private $disableSectionEditForRender = false;
+ protected $viewIsRenderAction = false;
/**
* Constructor and clear the article
if ( $outputPage->isPrintable() ) {
$parserOptions->setIsPrintable( true );
$poOptions['enableSectionEditLinks'] = false;
- } elseif ( $this->disableSectionEditForRender
+ } elseif ( $this->viewIsRenderAction
|| !$this->isCurrent() || !$this->getTitle()->quickUserCan( 'edit', $user )
) {
$poOptions['enableSectionEditLinks'] = false;
public function render() {
$this->getContext()->getRequest()->response()->header( 'X-Robots-Tag: noindex' );
$this->getContext()->getOutput()->setArticleBodyOnly( true );
- $this->disableSectionEditForRender = true;
+ // We later set 'enableSectionEditLinks=false' based on this; also used by ImagePage
+ $this->viewIsRenderAction = true;
$this->view();
}
$this->repo = $img->getRepo();
}
- /**
- * Handler for action=render
- * Include body text only; none of the image extras
- */
- public function render() {
- $this->getContext()->getOutput()->setArticleBodyOnly( true );
- parent::view();
- }
-
public function view() {
global $wgShowEXIF;
+ // For action=render, include body text only; none of the image extras
+ if ( $this->viewIsRenderAction ) {
+ parent::view();
+ return;
+ }
+
$out = $this->getContext()->getOutput();
$request = $this->getContext()->getRequest();
$diff = $request->getVal( 'diff' );