From b9225b8d9a983306f5bc33b621c122581eab1e7b Mon Sep 17 00:00:00 2001 From: daniel Date: Wed, 13 Jun 2012 11:59:40 +0200 Subject: [PATCH] make ApiPurge use ContentHandler for parsing --- includes/api/ApiPurge.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/includes/api/ApiPurge.php b/includes/api/ApiPurge.php index 66aa3b0ed2..a01eca9c01 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->setTidy( true ); - $p_result = $wgParser->parse( $page->getRawText(), $title, $popts, - true, true, $page->getLatest() ); #FIXME: content! + + # 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 ); #FIXME: content handler + $updates = $content->getContentHandler()->getSecondaryDataUpdates( $content, $title, null, true, $p_result ); DataUpdate::runUpdates( $updates ); $r['linkupdate'] = ''; -- 2.20.1