Use ContextSource::getLanguage instead of $wgLang
authorumherirrender <umherirrender_de.wp@web.de>
Sat, 9 Mar 2013 16:02:44 +0000 (17:02 +0100)
committerumherirrender <umherirrender_de.wp@web.de>
Sat, 9 Mar 2013 16:02:44 +0000 (17:02 +0100)
Found two places, where $wgLang is used inside a ContextSource.

Change-Id: I1881a20d3cd9b50eb4af0cd588451ed941f936fa

includes/OutputPage.php
includes/api/ApiQueryAllMessages.php

index 62219e2..6bcc625 100644 (file)
@@ -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 );
index b0ecca8..0555a39 100644 (file)
@@ -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'] );
                }