From f8d58ec3eaf6ad37899ee33b00517a151ab8b29e Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Fri, 22 Sep 2017 02:05:15 -0700 Subject: [PATCH] EditPage: Avoid unnecessary calls to Article::getContext() Change-Id: I18a7f3b3eb1a9b18ea6ca20ad43878f4740f4e47 --- includes/EditPage.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 1588f822e1..a8ed19db94 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1684,7 +1684,7 @@ class EditPage { // Run new style post-section-merge edit filter if ( !Hooks::run( 'EditFilterMergedContent', - [ $this->mArticle->getContext(), $content, $status, $this->summary, + [ $this->context, $content, $status, $this->summary, $user, $this->minoredit ] ) ) { # Error messages etc. could be handled within the hook... @@ -3477,7 +3477,7 @@ class EditPage { $newContent = $oldContent->getContentHandler()->makeEmptyContent(); } - $de = $oldContent->getContentHandler()->createDifferenceEngine( $this->mArticle->getContext() ); + $de = $oldContent->getContentHandler()->createDifferenceEngine( $this->context ); $de->setContent( $oldContent, $newContent ); $difftext = $de->getDiff( $oldtitle, $newtitle ); @@ -3685,7 +3685,7 @@ class EditPage { $content2 = $this->toEditContent( $this->textbox2 ); $handler = ContentHandler::getForModelID( $this->contentModel ); - $de = $handler->createDifferenceEngine( $this->mArticle->getContext() ); + $de = $handler->createDifferenceEngine( $this->context ); $de->setContent( $content2, $content1 ); $de->showDiff( $this->context->msg( 'yourtext' )->parse(), @@ -3968,7 +3968,7 @@ class EditPage { * @return ParserOptions */ protected function getPreviewParserOptions() { - $parserOptions = $this->page->makeParserOptions( $this->mArticle->getContext() ); + $parserOptions = $this->page->makeParserOptions( $this->context ); $parserOptions->setIsPreview( true ); $parserOptions->setIsSectionPreview( !is_null( $this->section ) && $this->section !== '' ); $parserOptions->enableLimitReport(); -- 2.20.1