Index: trunk/extensions/ApprovedRevs/ApprovedRevs.php |
— | — | @@ -64,7 +64,7 @@ |
65 | 65 | $wgHooks['LoadExtensionSchemaUpdates'][] = 'ApprovedRevsHooks::describeDBSchema'; |
66 | 66 | $wgHooks['EditPage::showEditForm:initial'][] = 'ApprovedRevsHooks::addWarningToEditPage'; |
67 | 67 | $wgHooks['sfHTMLBeforeForm'][] = 'ApprovedRevsHooks::addWarningToSFForm'; |
68 | | -$wgHooks['ArticleViewHeader'][] = 'ApprovedRevsHooks::onArticleViewHeader'; |
| 68 | +$wgHooks['ArticleViewHeader'][] = 'ApprovedRevsHooks::setArticleHeader'; |
69 | 69 | |
70 | 70 | // logging |
71 | 71 | $wgLogTypes['approval'] = 'approval'; |
Index: trunk/extensions/ApprovedRevs/ApprovedRevs.hooks.php |
— | — | @@ -584,7 +584,7 @@ |
585 | 585 | * |
586 | 586 | * @return true |
587 | 587 | */ |
588 | | - public static function onArticleViewHeader( Article &$article, &$outputDone, &$useParserCache ) { |
| 588 | + public static function setArticleHeader( Article &$article, &$outputDone, &$useParserCache ) { |
589 | 589 | global $wgOut, $wgRequest, $egApprovedRevsBlankIfUnapproved; |
590 | 590 | |
591 | 591 | if ( ApprovedRevs::pageIsApprovable( $article->getTitle() ) |
— | — | @@ -594,6 +594,10 @@ |
595 | 595 | |
596 | 596 | if ( $egApprovedRevsBlankIfUnapproved && |
597 | 597 | ( empty( $approvedId ) || ( $wgRequest->getCheck( 'oldid' ) && $wgRequest->getInt( 'oldid' ) != $approvedId ) ) ) { |
| 598 | + // Disable caching, so that if it's a specific |
| 599 | + // ID being shown that happens to be the |
| 600 | + // latest, it doesn't show a blank page. |
| 601 | + $useParserCache = false; |
598 | 602 | $wgOut->addHTML( '<span style="margin-left:10.75px">' ); |
599 | 603 | |
600 | 604 | if ( $wgRequest->getCheck( 'oldid' ) ) { |
— | — | @@ -629,5 +633,4 @@ |
630 | 634 | |
631 | 635 | return true; |
632 | 636 | } |
633 | | - |
634 | 637 | } |