Follow up I66fb2d11: use wfGetLangObj() instead
authorSiebrand Mazeland <s.mazeland@xs4all.nl>
Wed, 22 Aug 2012 19:29:18 +0000 (21:29 +0200)
committerSiebrand Mazeland <s.mazeland@xs4all.nl>
Wed, 22 Aug 2012 19:31:05 +0000 (21:31 +0200)
Change-Id: I333021ee4edc7481b664986c27e12fbcac9d0d08

includes/Linker.php

index 32a99cb..ce81d1c 100644 (file)
@@ -1594,11 +1594,9 @@ class Linker {
         * @return String: full html of the TOC
         */
        public static function tocList( $toc, $lang = false ) {
-               $msg = wfMessage( 'toc' );
-               if ( $lang !== false ) {
-                       $msg = $msg->inLanguage( $lang );
-               }
-               $title = $msg->escaped();
+               $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"