Merge "logging: Start using LinkTarget & UserIdentity in ManualLogEntry"
[lhc/web/wiklou.git] / includes / Linker.php
index 2c7f44c..3e50ac6 100644 (file)
@@ -1607,9 +1607,8 @@ class Linker {
         * @return string Full html of the TOC
         */
        public static function tocList( $toc, $lang = null ) {
-               global $wgLang;
-               $lang = $lang ?? $wgLang;
-               if ( !is_object( $lang ) ) {
+               $lang = $lang ?? RequestContext::getMain()->getLanguage();
+               if ( !$lang instanceof Language ) {
                        wfDeprecated( __METHOD__ . ' with type other than Language for $lang', '1.33' );
                        $lang = wfGetLangObj( $lang );
                }