Merge "Fix tocList() breakage in 6fe1f050"
authorAaron Schulz <aschulz@wikimedia.org>
Wed, 22 Aug 2012 19:24:21 +0000 (19:24 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 22 Aug 2012 19:24:21 +0000 (19:24 +0000)
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"