Follow-up r100227:
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 19 Oct 2011 15:30:02 +0000 (15:30 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Wed, 19 Oct 2011 15:30:02 +0000 (15:30 +0000)
* Missed one call to ParserOptions::getUserLang() in Parser
* Also convert RefreshLinksJob and RefreshLinksJob2 to use ParserOptions::newFromUserAndLang() and pass $wgContLang instead of whatever $wgLang could be

includes/job/RefreshLinksJob.php
includes/parser/Parser.php

index 99644f5..1aa206f 100644 (file)
@@ -22,7 +22,7 @@ class RefreshLinksJob extends Job {
         * @return boolean success
         */
        function run() {
-               global $wgParser;
+               global $wgParser, $wgContLang;
                wfProfileIn( __METHOD__ );
 
                $linkCache = LinkCache::singleton();
@@ -42,7 +42,7 @@ class RefreshLinksJob extends Job {
                }
 
                wfProfileIn( __METHOD__.'-parse' );
-               $options = new ParserOptions;
+               $options = ParserOptions::newFromUserAndLang( new User, $wgContLang );
                $parserOutput = $wgParser->parse( $revision->getText(), $this->title, $options, true, true, $revision->getId() );
                wfProfileOut( __METHOD__.'-parse' );
                wfProfileIn( __METHOD__.'-update' );
@@ -71,7 +71,7 @@ class RefreshLinksJob2 extends Job {
         * @return boolean success
         */
        function run() {
-               global $wgParser;
+               global $wgParser, $wgContLang;
 
                wfProfileIn( __METHOD__ );
 
@@ -105,6 +105,7 @@ class RefreshLinksJob2 extends Job {
                        wfProfileOut( __METHOD__ );
                        return true;
                }
+               $options = ParserOptions::newFromUserAndLang( new User, $wgContLang );
                # Re-parse each page that transcludes this page and update their tracking links...
                foreach ( $titles as $title ) {
                        $revision = Revision::newFromTitle( $title );
@@ -114,7 +115,6 @@ class RefreshLinksJob2 extends Job {
                                return false;
                        }
                        wfProfileIn( __METHOD__.'-parse' );
-                       $options = new ParserOptions;
                        $parserOutput = $wgParser->parse( $revision->getText(), $title, $options, true, true, $revision->getId() );
                        wfProfileOut( __METHOD__.'-parse' );
                        wfProfileIn( __METHOD__.'-update' );
index a9c1dc7..94ca585 100644 (file)
@@ -4183,7 +4183,7 @@ class Parser {
                        if ( $prevtoclevel > 0 && $prevtoclevel < $wgMaxTocLevel ) {
                                $toc .= Linker::tocUnindent( $prevtoclevel - 1 );
                        }
-                       $toc = Linker::tocList( $toc, $this->mOptions->getUserLang() );
+                       $toc = Linker::tocList( $toc, $this->mOptions->getUserLangObj() );
                        $this->mOutput->setTOCHTML( $toc );
                }