From 5b1a5aa76327d9391c468e29e46063540d132537 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 2 Jan 2011 03:20:45 +0000 Subject: [PATCH] ApiQueryRevisions: Switch from manual Cache checking, to use $article->getParserOutput() ApiParse: Fix comment typo --- includes/api/ApiParse.php | 2 +- includes/api/ApiQueryRevisions.php | 17 +---------------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/includes/api/ApiParse.php b/includes/api/ApiParse.php index 42a0047e60..6fb0489c1a 100644 --- a/includes/api/ApiParse.php +++ b/includes/api/ApiParse.php @@ -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 ) { diff --git a/includes/api/ApiQueryRevisions.php b/includes/api/ApiQueryRevisions.php index 5565555b34..6c1581ad52 100644 --- a/includes/api/ApiQueryRevisions.php +++ b/includes/api/ApiQueryRevisions.php @@ -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(); } -- 2.20.1