From: Alexandre Emsenhuber Date: Mon, 23 Apr 2012 06:12:12 +0000 (+0200) Subject: Use $wgContLang and an anonymous user in refreshLinks.php to parse pages. X-Git-Tag: 1.31.0-rc.0~23838^2 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=5208ddbaac15f51a0aa73cab255e5dd16f97eb8c;p=lhc%2Fweb%2Fwiklou.git Use $wgContLang and an anonymous user in refreshLinks.php to parse pages. Normally it should already be correct, but just in case it gets broken for some reason. Change-Id: Ia38df1ba1f4a6224296bfd837a515ce0ccdf55cb --- diff --git a/maintenance/refreshLinks.php b/maintenance/refreshLinks.php index 7abbc907a9..a7c7ec4ab9 100644 --- a/maintenance/refreshLinks.php +++ b/maintenance/refreshLinks.php @@ -201,7 +201,7 @@ class RefreshLinks extends Maintenance { * @param $id int The page_id */ public static function fixLinksFromArticle( $id ) { - global $wgParser; + global $wgParser, $wgContLang; $title = Title::newFromID( $id ); $dbw = wfGetDB( DB_MASTER ); @@ -219,7 +219,7 @@ class RefreshLinks extends Maintenance { $dbw->begin( __METHOD__ ); - $options = new ParserOptions; + $options = ParserOptions::newFromUserAndLang( new User, $wgContLang ); $parserOutput = $wgParser->parse( $revision->getText(), $title, $options, true, true, $revision->getId() ); $update = new LinksUpdate( $title, $parserOutput, false ); $update->doUpdate();