r100232 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100231‎ | r100232 | r100233 >
Date:15:30, 19 October 2011
Author:ialex
Status:ok
Tags:
Comment:
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
Modified paths:
  • /trunk/phase3/includes/job/RefreshLinksJob.php (modified) (history)
  • /trunk/phase3/includes/parser/Parser.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/parser/Parser.php
@@ -4183,7 +4183,7 @@
41844184 if ( $prevtoclevel > 0 && $prevtoclevel < $wgMaxTocLevel ) {
41854185 $toc .= Linker::tocUnindent( $prevtoclevel - 1 );
41864186 }
4187 - $toc = Linker::tocList( $toc, $this->mOptions->getUserLang() );
 4187+ $toc = Linker::tocList( $toc, $this->mOptions->getUserLangObj() );
41884188 $this->mOutput->setTOCHTML( $toc );
41894189 }
41904190
Index: trunk/phase3/includes/job/RefreshLinksJob.php
@@ -22,7 +22,7 @@
2323 * @return boolean success
2424 */
2525 function run() {
26 - global $wgParser;
 26+ global $wgParser, $wgContLang;
2727 wfProfileIn( __METHOD__ );
2828
2929 $linkCache = LinkCache::singleton();
@@ -42,7 +42,7 @@
4343 }
4444
4545 wfProfileIn( __METHOD__.'-parse' );
46 - $options = new ParserOptions;
 46+ $options = ParserOptions::newFromUserAndLang( new User, $wgContLang );
4747 $parserOutput = $wgParser->parse( $revision->getText(), $this->title, $options, true, true, $revision->getId() );
4848 wfProfileOut( __METHOD__.'-parse' );
4949 wfProfileIn( __METHOD__.'-update' );
@@ -71,7 +71,7 @@
7272 * @return boolean success
7373 */
7474 function run() {
75 - global $wgParser;
 75+ global $wgParser, $wgContLang;
7676
7777 wfProfileIn( __METHOD__ );
7878
@@ -105,6 +105,7 @@
106106 wfProfileOut( __METHOD__ );
107107 return true;
108108 }
 109+ $options = ParserOptions::newFromUserAndLang( new User, $wgContLang );
109110 # Re-parse each page that transcludes this page and update their tracking links...
110111 foreach ( $titles as $title ) {
111112 $revision = Revision::newFromTitle( $title );
@@ -114,7 +115,6 @@
115116 return false;
116117 }
117118 wfProfileIn( __METHOD__.'-parse' );
118 - $options = new ParserOptions;
119119 $parserOutput = $wgParser->parse( $revision->getText(), $title, $options, true, true, $revision->getId() );
120120 wfProfileOut( __METHOD__.'-parse' );
121121 wfProfileIn( __METHOD__.'-update' );

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r100227* Changed ParserOptions to store a Language object instead of only a string, ...ialex14:16, 19 October 2011

Status & tagging log