Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -1684,8 +1684,9 @@ |
1685 | 1685 | } |
1686 | 1686 | |
1687 | 1687 | public static function overrideRedirect( |
1688 | | - &$title, $request, &$ignoreRedirect, &$target, &$article |
| 1688 | + Title &$title, WebRequest $request, &$ignoreRedirect, &$target, Article &$article |
1689 | 1689 | ) { |
| 1690 | + global $wgMemc, $wgParserCacheExpireTime; |
1690 | 1691 | # Get an instance on the title ($wgTitle) |
1691 | 1692 | if ( !FlaggedRevs::inReviewNamespace( $title ) ) { |
1692 | 1693 | return true; |
— | — | @@ -1693,12 +1694,11 @@ |
1694 | 1695 | if ( $request->getVal( 'stableid' ) ) { |
1695 | 1696 | $ignoreRedirect = true; |
1696 | 1697 | } else { |
1697 | | - global $wgMemc, $wgParserCacheExpireTime; |
1698 | 1698 | # Try the cache... |
1699 | 1699 | $key = wfMemcKey( 'flaggedrevs', 'overrideRedirect', $title->getArticleId() ); |
1700 | | - $data = $wgMemc->get( $key ); |
1701 | | - if ( is_object( $data ) && $data->time >= $article->getTouched() ) { |
1702 | | - list( $ignoreRedirect, $target ) = $data->value; |
| 1700 | + $tuple = FlaggedRevs::getMemcValue( $wgMemc->get( $key ), $article ); |
| 1701 | + if ( is_array( $tuple ) ) { |
| 1702 | + list( $ignoreRedirect, $target ) = $tuple; |
1703 | 1703 | return true; |
1704 | 1704 | } |
1705 | 1705 | $fa = FlaggedArticle::getTitleInstance( $title ); |
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php |
— | — | @@ -545,6 +545,8 @@ |
546 | 546 | $this->article, $text, $srev->getRevId() ); |
547 | 547 | # Update the stable version cache |
548 | 548 | FlaggedRevs::updatePageCache( $this->article, $wgUser, $parserOut ); |
| 549 | + } else { |
| 550 | + $parserOut = null; |
549 | 551 | } |
550 | 552 | } |
551 | 553 | $synced = FlaggedRevs::stableVersionIsSynced( $srev, $this->article, $parserOut, null ); |
— | — | @@ -597,6 +599,7 @@ |
598 | 600 | if ( $redirHtml != '' ) { |
599 | 601 | $wgOut->addHtml( $redirHtml ); |
600 | 602 | } else { |
| 603 | + // $parserOut will not be null here |
601 | 604 | $wgOut->addParserOutput( $parserOut ); |
602 | 605 | } |
603 | 606 | } |
— | — | @@ -1444,8 +1447,9 @@ |
1445 | 1448 | |
1446 | 1449 | /** |
1447 | 1450 | * Set $this->isDiffFromStable and $this->isMultiPageDiff fields |
| 1451 | + * Note: $oldRev could be false |
1448 | 1452 | */ |
1449 | | - public function setViewFlags( $diff, Revision $oldRev, Revision $newRev ) { |
| 1453 | + public function setViewFlags( $diff, $oldRev, $newRev ) { |
1450 | 1454 | $this->load(); |
1451 | 1455 | if ( $newRev && $oldRev ) { |
1452 | 1456 | // Is this a diff between two pages? |