X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fapi%2FApiPurge.php;h=3cf32adc917d74a362c7415e2d9c2fb27ec6dde4;hb=7af8c74e1a799f26ba81fc95d8f0f2dbead52bfc;hp=e27068d1569b61b677e9ad61b3a43780ba77f8c8;hpb=03f81522c5a7a0aa758a30183288709f17f36cb9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php index e27068d156..3cf32adc91 100644 --- a/includes/api/ApiPurge.php +++ b/includes/api/ApiPurge.php @@ -86,15 +86,17 @@ class ApiPurge extends ApiBase { if( $forceLinkUpdate ) { if ( !$user->pingLimiter() ) { - global $wgParser, $wgEnableParserCache; + global $wgEnableParserCache; - $popts = ParserOptions::newFromContext( $this->getContext() ); + $popts = $page->makeParserOptions( 'canonical' ); $popts->setTidy( true ); - $p_result = $wgParser->parse( $page->getRawText(), $title, $popts, - true, true, $page->getLatest() ); + + # Parse content; note that HTML generation is only needed if we want to cache the result. + $content = $page->getContent( Revision::RAW ); + $p_result = $content->getParserOutput( $title, $page->getLatest(), $popts, $wgEnableParserCache ); # Update the links tables - $updates = $p_result->getSecondaryDataUpdates( $title ); + $updates = $content->getSecondaryDataUpdates( $title, null, true, $p_result ); DataUpdate::runUpdates( $updates ); $r['linkupdate'] = ''; @@ -173,7 +175,6 @@ class ApiPurge extends ApiBase { $psModule = new ApiPageSet( $this ); return array_merge( parent::getPossibleErrors(), - array( array( 'cantpurge' ), ), $psModule->getPossibleErrors() ); }