X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2FrefreshLinks.php;h=9ba86826661aad37189fbb6088a41d89e7b57866;hb=d26f07888b8002fd1a7f5101fe5f6a70bbb85e2a;hp=3d9270b8d3286995a5f9b4a73511759d3ea58059;hpb=987319a54adf9f6208534b5ac3b60d6f88bbf7e4;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/refreshLinks.php b/maintenance/refreshLinks.php index 3d9270b8d3..9ba8682666 100644 --- a/maintenance/refreshLinks.php +++ b/maintenance/refreshLinks.php @@ -206,8 +206,6 @@ class RefreshLinks extends Maintenance { * @param $id int The page_id */ public static function fixLinksFromArticle( $id ) { - global $wgParser, $wgContLang; - $page = WikiPage::newFromID( $id ); LinkCache::singleton()->clear(); @@ -216,18 +214,16 @@ class RefreshLinks extends Maintenance { return; } - $text = $page->getRawText(); - if ( $text === false ) { + $content = $page->getContent( Revision::RAW ); + if ( null === false ) { return; } $dbw = wfGetDB( DB_MASTER ); $dbw->begin( __METHOD__ ); - $options = ParserOptions::newFromUserAndLang( new User, $wgContLang ); - $parserOutput = $wgParser->parse( $text, $page->getTitle(), $options, true, true, $page->getLatest() ); - $update = new LinksUpdate( $page->getTitle(), $parserOutput, false ); - $update->doUpdate(); + $updates = $content->getSecondaryDataUpdates( $page->getTitle() ); + DataUpdate::runUpdates( $updates ); $dbw->commit( __METHOD__ ); }