ApiQueryRevisions: Switch from manual Cache checking, to use $article->getParserOutput()
authorSam Reed <reedy@users.mediawiki.org>
Sun, 2 Jan 2011 03:20:45 +0000 (03:20 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 2 Jan 2011 03:20:45 +0000 (03:20 +0000)
ApiParse: Fix comment typo

includes/api/ApiParse.php
includes/api/ApiQueryRevisions.php

index 42a0047..6fb0489 100644 (file)
@@ -282,7 +282,7 @@ class ApiParse extends ApiBase {
         * @param  $articleObj Article
         * @param  $titleObj Title
         * @param  $pageId Int
-        * @param $pots ParserOptions
+        * @param  $popts ParserOptions
         * @return ParserOutput
         */
        private function getParsedSectionOrText( $articleObj, $titleObj, $popts, $pageId = null ) {
index 5565555..6c1581a 100644 (file)
@@ -479,25 +479,10 @@ class ApiQueryRevisions extends ApiQueryBase {
                                $text = $wgParser->preprocess( $text, $title, new ParserOptions() );
                        }
                        if ( $this->parseContent ) {
-                               global $wgEnableParserCache;
-
-                               $popts = new ParserOptions();
-                               $popts->setTidy( true );
-
                                $articleObj = new Article( $title );
 
-                               $p_result = false;
+                               $p_result = $articleObj->getParserOutput();
                                $pcache = ParserCache::singleton();
-                               if ( $wgEnableParserCache ) {
-                                       $p_result = $pcache->get( $articleObj, $popts );
-                               }
-                               if ( !$p_result ) {
-                                       $p_result = $wgParser->parse( $text, $title, $popts );
-
-                                       if ( $wgEnableParserCache ) {
-                                               $pcache->save( $p_result, $articleObj, $popts );
-                                       }
-                               }
 
                                $text = $p_result->getText();
                        }