Index: trunk/extensions/FlaggedRevs/FlaggedRevs.php |
— | — | @@ -282,12 +282,18 @@ |
283 | 283 | |
284 | 284 | function wfInitFlaggedArticle( $title, $article ) { |
285 | 285 | global $wgFlaggedArticle, $wgHooks; |
286 | | - if( !FlaggedRevs::isPageReviewable( $title ) ) |
| 286 | + if( $title->isRedirect() || !FlaggedRevs::isPageReviewable($title) ) |
287 | 287 | return true; |
288 | 288 | # Initialize and set article hooks |
289 | 289 | $wgFlaggedArticle = new FlaggedArticle( $title ); |
290 | 290 | # Set image version |
291 | 291 | $wgFlaggedArticle->setImageVersion(); |
| 292 | + # Always prevent hooks from doubling up |
| 293 | + if( FlaggedRevs::$articleLoaded ) { |
| 294 | + wfDebug( 'Warning - $wgFlaggedArticle already loaded!' ); |
| 295 | + return true; |
| 296 | + } |
| 297 | + FlaggedRevs::$articleLoaded = true; |
292 | 298 | # Main hooks, overrides pages content, adds tags, sets tabs and permalink |
293 | 299 | $wgHooks['SkinTemplateTabs'][] = array( $wgFlaggedArticle, 'setActionTabs' ); |
294 | 300 | # Change last-modified footer |
— | — | @@ -340,6 +346,7 @@ |
341 | 347 | class FlaggedRevs { |
342 | 348 | public static $dimensions = array(); |
343 | 349 | public static $styleLoaded = false; |
| 350 | + public static $articleLoaded = false; |
344 | 351 | |
345 | 352 | public static function load() { |
346 | 353 | global $wgFlaggedRevTags, $wgFlaggedRevValues; |
Index: trunk/extensions/FlaggedRevs/FlaggedArticle.php |
— | — | @@ -93,7 +93,7 @@ |
94 | 94 | */ |
95 | 95 | public function setPageContent( $article, &$outputDone, &$pcache ) { |
96 | 96 | global $wgRequest, $wgOut, $wgUser, $wgLang; |
97 | | - ## Only trigger for reviewable pages |
| 97 | + # Only trigger for reviewable pages |
98 | 98 | if( !FlaggedRevs::isPageReviewable( $article->getTitle() ) ) { |
99 | 99 | return true; |
100 | 100 | } |