From d819a2aafc371bbe06d98baf86e34dc9bfa94154 Mon Sep 17 00:00:00 2001 From: Kunal Mehta Date: Tue, 12 Sep 2017 11:31:43 -0700 Subject: [PATCH] EditPage: Stop using $wgLang Change-Id: Ifca2cdcff45b4e06aef6e06dc5a3b852752a7a1a --- includes/EditPage.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/includes/EditPage.php b/includes/EditPage.php index 06a5cc3b62..352a926b7b 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -3794,7 +3794,7 @@ class EditPage { * @return string */ public function getPreviewText() { - global $wgRawHtml, $wgLang; + global $wgRawHtml; global $wgAllowUserCss, $wgAllowUserJs; $out = $this->context->getOutput(); @@ -3830,7 +3830,8 @@ class EditPage { # provide a anchor link to the editform $continueEditing = '' . - '[[#' . self::EDITFORM_ID . '|' . $wgLang->getArrow() . ' ' . + '[[#' . self::EDITFORM_ID . '|' . + $this->context->getLanguage()->getArrow() . ' ' . $this->context->msg( 'continue-editing' )->text() . ']]'; if ( $this->mTriedSave && !$this->mTokenOk ) { if ( $this->mTokenOkExceptSuffix ) { @@ -4448,11 +4449,10 @@ class EditPage { * @param string|array|bool $match Text (or array of texts) which triggered one or more filters */ public function spamPageWithContent( $match = false ) { - global $wgLang; $this->textbox2 = $this->textbox1; if ( is_array( $match ) ) { - $match = $wgLang->listToText( $match ); + $match = $this->context->getLanguage()->listToText( $match ); } $out = $this->context->getOutput(); $out->prepareErrorPage( $this->context->msg( 'spamprotectiontitle' ) ); @@ -4640,19 +4640,20 @@ class EditPage { * @since 1.29 */ protected function addLongPageWarningHeader() { - global $wgMaxArticleSize, $wgLang; + global $wgMaxArticleSize; if ( $this->contentLength === false ) { $this->contentLength = strlen( $this->textbox1 ); } $out = $this->context->getOutput(); + $lang = $this->context->getLanguage(); if ( $this->tooBig || $this->contentLength > $wgMaxArticleSize * 1024 ) { $out->wrapWikiMsg( "
\n$1\n
", [ 'longpageerror', - $wgLang->formatNum( round( $this->contentLength / 1024, 3 ) ), - $wgLang->formatNum( $wgMaxArticleSize ) + $lang->formatNum( round( $this->contentLength / 1024, 3 ) ), + $lang->formatNum( $wgMaxArticleSize ) ] ); } else { @@ -4660,7 +4661,7 @@ class EditPage { $out->wrapWikiMsg( "
\n$1\n
", [ 'longpage-hint', - $wgLang->formatSize( strlen( $this->textbox1 ) ), + $lang->formatSize( strlen( $this->textbox1 ) ), strlen( $this->textbox1 ) ] ); -- 2.20.1