From d491ae56a77af63e8a04cbf34b44afd0a908fa69 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Wed, 19 Oct 2011 15:30:02 +0000 Subject: [PATCH] Follow-up r100227: * 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 | 8 ++++---- includes/parser/Parser.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/job/RefreshLinksJob.php b/includes/job/RefreshLinksJob.php index 99644f57b6..1aa206f04a 100644 --- a/includes/job/RefreshLinksJob.php +++ b/includes/job/RefreshLinksJob.php @@ -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' ); diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index a9c1dc7ed0..94ca585261 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -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 ); } -- 2.20.1