Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php |
— | — | @@ -515,7 +515,7 @@ |
516 | 516 | * @param int $id Source revision Id |
517 | 517 | * @return ParserOutput |
518 | 518 | */ |
519 | | - public static function parseStableText( Title $title, $text, $id ) { |
| 519 | + public static function parseStableText( Title $title, $text, $id, $parserOptions = null ) { |
520 | 520 | global $wgParser; |
521 | 521 | # Notify Parser if includes should be stabilized |
522 | 522 | $resetManager = false; |
— | — | @@ -532,8 +532,9 @@ |
533 | 533 | } |
534 | 534 | } |
535 | 535 | # Parse the new body, wikitext -> html |
536 | | - $options = self::makeParserOptions(); // default options |
537 | | - $parserOut = $wgParser->parse( $text, $title, $options, true, true, $id ); |
| 536 | + if ( is_null( $parserOptions ) ) |
| 537 | + $parserOptions = self::makeParserOptions(); // default options |
| 538 | + $parserOut = $wgParser->parse( $text, $title, $parserOptions, true, true, $id ); |
538 | 539 | # Stable parse done! |
539 | 540 | if ( $resetManager ) { |
540 | 541 | $incManager->clear(); // reset the FRInclusionManager as needed |
— | — | @@ -607,20 +608,20 @@ |
608 | 609 | /** |
609 | 610 | * Like ParserCache::getKey() with stable-pcache instead of pcache |
610 | 611 | */ |
611 | | - public static function getCacheKey( $parserCache, Article $article, $user ) { |
612 | | - $key = $parserCache->getKey( $article, $user ); |
| 612 | + protected static function getCacheKey( $parserCache, Article $article, $popts ) { |
| 613 | + $key = $parserCache->getKey( $article, $popts ); |
613 | 614 | $key = str_replace( ':pcache:', ':stable-pcache:', $key ); |
614 | 615 | return $key; |
615 | 616 | } |
616 | 617 | |
617 | 618 | /** |
618 | 619 | * @param Article $article |
619 | | - * @param User $user |
| 620 | + * @param ParserOptions $popts |
620 | 621 | * @param parserOutput $parserOut |
621 | 622 | * Updates the stable cache of a page with the given $parserOut |
622 | 623 | */ |
623 | 624 | public static function updatePageCache( |
624 | | - Article $article, $user, ParserOutput $parserOut = null |
| 625 | + Article $article, $popts, ParserOutput $parserOut = null |
625 | 626 | ) { |
626 | 627 | global $parserMemc, $wgParserCacheExpireTime, $wgEnableParserCache; |
627 | 628 | wfProfileIn( __METHOD__ ); |
— | — | @@ -630,7 +631,7 @@ |
631 | 632 | return false; |
632 | 633 | } |
633 | 634 | $parserCache = ParserCache::singleton(); |
634 | | - $key = self::getCacheKey( $parserCache, $article, $user ); |
| 635 | + $key = self::getCacheKey( $parserCache, $article, $popts ); |
635 | 636 | # Add cache mark to HTML |
636 | 637 | $now = wfTimestampNow(); |
637 | 638 | $parserOut->setCacheTime( $now ); |
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php |
— | — | @@ -497,7 +497,8 @@ |
498 | 498 | $redirHtml = $this->getRedirectHtml( $text ); |
499 | 499 | if ( $redirHtml == '' ) { |
500 | 500 | $parserOut = FlaggedRevs::parseStableText( |
501 | | - $this->article->getTitle(), $text, $frev->getRevId() ); |
| 501 | + $this->article->getTitle(), $text, $frev->getRevId(), |
| 502 | + FlaggedRevs::::makeParserOptions() ); |
502 | 503 | } |
503 | 504 | # Construct some tagging for non-printable outputs. Note that the pending |
504 | 505 | # notice has all this info already, so don't do this if we added that already. |
— | — | @@ -574,10 +575,11 @@ |
575 | 576 | # Don't parse redirects, use separate handling... |
576 | 577 | if ( $redirHtml == '' ) { |
577 | 578 | # Get the new stable output |
| 579 | + $parserOptions = FlaggedRevs::makeParserOptions(); |
578 | 580 | $parserOut = FlaggedRevs::parseStableText( |
579 | | - $this->article->getTitle(), $text, $srev->getRevId() ); |
| 581 | + $this->article->getTitle(), $text, $srev->getRevId(), $parserOptions ); |
580 | 582 | # Update the stable version cache & dependancies |
581 | | - FlaggedRevs::updatePageCache( $this->article, $wgUser, $parserOut ); |
| 583 | + FlaggedRevs::updatePageCache( $this->article, $parserOptions, $parserOut ); |
582 | 584 | FlaggedRevs::updateCacheTracking( $this->article, $parserOut ); |
583 | 585 | } else { |
584 | 586 | $parserOut = null; |