r94414 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r94413‎ | r94414 | r94415 >
Date:15:16, 13 August 2011
Author:ialex
Status:deferred
Tags:
Comment:
* Use Skin::getTitle() instead of $wgTitle
* Use correct variable, was throwing E_NOTICE
* Return true instead of false when the page doesn't exist so that it doesn't break other hooks
Modified paths:
  • /trunk/extensions/FlagPage/FlagPage.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlagPage/FlagPage.hooks.php
@@ -4,11 +4,10 @@
55 function __construct( ) { }
66
77 function insertTab( $skin, &$content_actions ) {
8 - global $wgTitle;
9 - if ( !$wgTitle->exists() ) {
10 - return false;
 8+ if ( !$skin->getTitle()->exists() ) {
 9+ return true;
1110 }
12 - $linkParam = "page=" . $wgTitle->getPrefixedURL();
 11+ $linkParam = "page=" . $skin->getTitle()->getPrefixedURL();
1312
1413 $special = SpecialPage::getTitleFor( 'FlagPage' );
1514 $content_actions['flagpage'] = array(
@@ -22,7 +21,7 @@
2322 // the old '$content_actions' array is thankfully just a
2423 // sub-array of this one
2524 // copied from Extension:ApprovedRevs (r74381). Author: yaron
26 - self::insertTab( $skin, $links['views'] );
 25+ self::insertTab( $sktemplate, $links['views'] );
2726 return true;
2827 }
2928 }

Status & tagging log