* Added iiprop=parsedcomment to prop=imageinfo, similar to prop=revisions
* Added rvparse to parse revisions. For performance reasons if this option is
used, rvlimit is enforced to 1.
+* If a action=parse request provides an oldid that is actually the current revision
+ id, try the parser cache, and save it to it if necessary
=== Languages updated in 1.17 ===
$this->dieUsage( "You don't have permission to view deleted revisions", 'permissiondenied' );
}
- $text = $rev->getText( Revision::FOR_THIS_USER );
$titleObj = $rev->getTitle();
+
$wgTitle = $titleObj;
- if ( $this->section !== false ) {
- $text = $this->getSectionText( $text, 'r' . $rev );
- }
+ //If for some reason the "oldid" is actually the current revision, it may be cached
+ if ( $titleObj->getLatestRevID() === $oldid ) {
+ $p_result = false;
+ $pcache = ParserCache::singleton();
+ if ( $wgEnableParserCache ) {
+ $p_result = $pcache->get( $titleObj, $popts );
+ }
+ if ( !$p_result ) {
+ $text = $rev->getText( Revision::FOR_THIS_USER );
+ $p_result = $wgParser->parse( $text, $titleObj, $popts );
+
+ if ( $wgEnableParserCache ) {
+ $pcache->save( $p_result, $titleObj, $popts );
+ }
+ }
+ } else {
+ $text = $rev->getText( Revision::FOR_THIS_USER );
+
+ $wgTitle = $titleObj;
- $p_result = $wgParser->parse( $text, $titleObj, $popts );
+ if ( $this->section !== false ) {
+ $text = $this->getSectionText( $text, 'r' . $rev );
+ }
+
+ $p_result = $wgParser->parse( $text, $titleObj, $popts );
+ }
} else {
if ( !is_null ( $pageid ) ) {
$titleObj = Title::newFromID( $pageid );