Use $wgContLang and an anonymous user in refreshLinks.php to parse pages.
authorAlexandre Emsenhuber <ialex.wiki@gmail.com>
Mon, 23 Apr 2012 06:12:12 +0000 (08:12 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Mon, 23 Apr 2012 07:11:24 +0000 (09:11 +0200)
Normally it should already be correct, but just in case it gets broken for some reason.

Change-Id: Ia38df1ba1f4a6224296bfd837a515ce0ccdf55cb

maintenance/refreshLinks.php

index 7abbc90..a7c7ec4 100644 (file)
@@ -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();