From 55183ad0b2a60a0d710cb9eeccad4f496bcc2b2f Mon Sep 17 00:00:00 2001 From: umherirrender Date: Sat, 9 Mar 2013 17:02:44 +0100 Subject: [PATCH] Use ContextSource::getLanguage instead of $wgLang Found two places, where $wgLang is used inside a ContextSource. Change-Id: I1881a20d3cd9b50eb4af0cd588451ed941f936fa --- includes/OutputPage.php | 5 ++--- includes/api/ApiQueryAllMessages.php | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/includes/OutputPage.php b/includes/OutputPage.php index 62219e2870..6bcc62568c 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -3400,8 +3400,7 @@ $templates * @return string */ public function buildCssLinks() { - global $wgUseSiteCss, $wgAllowUserCss, $wgAllowUserCssPrefs, - $wgLang, $wgContLang; + global $wgUseSiteCss, $wgAllowUserCss, $wgAllowUserCssPrefs, $wgContLang; $this->getSkin()->setupSkinUserCss( $this ); @@ -3435,7 +3434,7 @@ $templates // If needed, Janus it first. This is user-supplied CSS, so it's // assumed to be right for the content language directionality. $previewedCSS = $this->getRequest()->getText( 'wpTextbox1' ); - if ( $wgLang->getDir() !== $wgContLang->getDir() ) { + if ( $this->getLanguage()->getDir() !== $wgContLang->getDir() ) { $previewedCSS = CSSJanus::transform( $previewedCSS, true, false ); } $otherTags .= Html::inlineStyle( $previewedCSS ); diff --git a/includes/api/ApiQueryAllMessages.php b/includes/api/ApiQueryAllMessages.php index b0ecca856a..0555a393c2 100644 --- a/includes/api/ApiQueryAllMessages.php +++ b/includes/api/ApiQueryAllMessages.php @@ -39,8 +39,7 @@ class ApiQueryAllMessages extends ApiQueryBase { $params = $this->extractRequestParams(); if ( is_null( $params['lang'] ) ) { - global $wgLang; - $langObj = $wgLang; + $langObj = $this->getLanguage(); } else { $langObj = Language::factory( $params['lang'] ); } -- 2.20.1