Fix tocList() breakage in 6fe1f050
authorCatrope <roan.kattouw@gmail.com>
Wed, 22 Aug 2012 19:21:59 +0000 (12:21 -0700)
committerCatrope <roan.kattouw@gmail.com>
Wed, 22 Aug 2012 19:21:59 +0000 (12:21 -0700)
The $lang parameter defaults to false, but Message::inLanguage() doesn't
like false, so do an explicit check for false.

Change-Id: I66fb2d11269a988ae92b1594314807a4eed54f1b

includes/Linker.php

index 632cf43..32a99cb 100644 (file)
@@ -1594,7 +1594,11 @@ class Linker {
         * @return String: full html of the TOC
         */
        public static function tocList( $toc, $lang = false ) {
-               $title = wfMessage( 'toc' )->inLanguage( $lang )->escaped();
+               $msg = wfMessage( 'toc' );
+               if ( $lang !== false ) {
+                       $msg = $msg->inLanguage( $lang );
+               }
+               $title = $msg->escaped();
                return
                   '<table id="toc" class="toc"><tr><td>'
                 . '<div id="toctitle"><h2>' . $title . "</h2></div>\n"