make ApiPurge use ContentHandler for parsing
authordaniel <daniel.kinzler@wikimedia.de>
Wed, 13 Jun 2012 09:59:40 +0000 (11:59 +0200)
committerdaniel <daniel.kinzler@wikimedia.de>
Wed, 13 Jun 2012 09:59:40 +0000 (11:59 +0200)
includes/api/ApiPurge.php

index 66aa3b0..a01eca9 100644 (file)
@@ -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'] = '';