http://www.mediawiki.org/wiki/Special:Code/MediaWiki/88780
Revision: 88780 Author: aaron Date: 2011-05-25 10:11:06 +0000 (Wed, 25 May 2011) Log Message: ----------- * Follow-up r88740: * Fixed parse() arguments in getRevIncludes() * Changed clearTagHook() to avoid preprocessed-xml cache corruption * Check current version cache in getRevIncludes() Modified Paths: -------------- trunk/extensions/FlaggedRevs/business/RevisionReviewForm.php trunk/phase3/includes/parser/Parser.php Modified: trunk/extensions/FlaggedRevs/business/RevisionReviewForm.php =================================================================== --- trunk/extensions/FlaggedRevs/business/RevisionReviewForm.php 2011-05-25 08:01:10 UTC (rev 88779) +++ trunk/extensions/FlaggedRevs/business/RevisionReviewForm.php 2011-05-25 10:11:06 UTC (rev 88780) @@ -601,13 +601,21 @@ if ( is_array( $val ) ) { $versions = $val; // cache hit } else { - $title = $article->getTitle(); - $pOpts = ParserOptions::newFromUser( $user ); // Note: tidy off - # Disable slow crap that doesn't matter for getting templates/files... - $parser = clone $wgParser; - $parser->clearTagHook( 'ref' ); - $parser->clearTagHook( 'references' ); - $pOut = $parser->parse( $rev->getText(), $title, $pOpts, $rev->getId() ); + $pOut = false; + if ( $rev->isCurrent() ) { // try current version parser cache + $parserCache = ParserCache::singleton(); + $pOut = $parserCache->get( $article, $article->makeParserOptions( $user ) ); + } + if ( $pOut == false ) { + $title = $article->getTitle(); + $pOpts = ParserOptions::newFromUser( $user ); // Note: tidy off + # Disable slow crap that doesn't matter for getting templates/files... + $parser = clone $wgParser; + $parser->clearTagHook( 'ref' ); + $parser->clearTagHook( 'references' ); + $pOut = $parser->parse( + $rev->getText(), $title, $pOpts, true, true, $rev->getId() ); + } # Get the template/file versions used... $versions = array( $pOut->getTemplateIds(), $pOut->getImageTimeKeys() ); # Save to cache... Modified: trunk/phase3/includes/parser/Parser.php =================================================================== --- trunk/phase3/includes/parser/Parser.php 2011-05-25 08:01:10 UTC (rev 88779) +++ trunk/phase3/includes/parser/Parser.php 2011-05-25 10:11:06 UTC (rev 88780) @@ -4531,6 +4531,7 @@ /** * Remove a specific tag hook. Should not be called on $wgParser. + * Does not change the strip list. * * @param string $tag * @return void @@ -4538,10 +4539,6 @@ function clearTagHook( $tag ) { if ( isset( $this->mTagHooks[$tag] ) ) { unset( $this->mTagHooks[$tag] ); - $key = array_search( $tag, $this->mStripList ); - if ( $key !== false ) { - unset( $this->mStripList[$key] ); - } } } _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs