Merge "(bug 38556) Add header and footer messages to MediaWiki's info action"
[lhc/web/wiklou.git] / includes / Linker.php
index 632cf43..7aba444 100644 (file)
@@ -1590,11 +1590,13 @@ class Linker {
         * Wraps the TOC in a table and provides the hide/collapse javascript.
         *
         * @param $toc String: html of the Table Of Contents
-        * @param $lang mixed: Language code for the toc title
+        * @param $lang String|Language|false: Language for the toc title, defaults to user language
         * @return String: full html of the TOC
         */
        public static function tocList( $toc, $lang = false ) {
+               $lang = wfGetLangObj( $lang );
                $title = wfMessage( 'toc' )->inLanguage( $lang )->escaped();
+
                return
                   '<table id="toc" class="toc"><tr><td>'
                 . '<div id="toctitle"><h2>' . $title . "</h2></div>\n"
@@ -1861,7 +1863,6 @@ class Linker {
         * @return String: HTML output
         */
        public static function formatHiddenCategories( $hiddencats ) {
-               global $wgLang;
                wfProfileIn( __METHOD__ );
 
                $outText = '';