r44028 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44027‎ | r44028 | r44029 >
Date:19:19, 28 November 2008
Author:aaron
Status:ok (Comments)
Tags:
Comment:
Minor code tweaks
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -76,7 +76,7 @@
7777 */
7878 public static function InjectStyleForSpecial() {
7979 global $wgTitle, $wgOut, $wgUser;
80 - if( empty($wgTitle) || $wgTitle->getNamespace() !== -1 ) {
 80+ if( empty($wgTitle) || $wgTitle->getNamespace() !== NS_SPECIAL ) {
8181 return true;
8282 }
8383 $spPages = array( 'UnreviewedPages', 'OldReviewedPages', 'Watchlist', 'Recentchanges',
@@ -105,8 +105,8 @@
106106 array( 'fr_page_id' => $revision->getPage() ),
107107 array( 'fr_page_id' => $oldPageID,
108108 'fr_rev_id' => $revision->getID() ),
109 - __METHOD__ );
110 -
 109+ __METHOD__
 110+ );
111111 return true;
112112 }
113113
@@ -150,8 +150,8 @@
151151 $dbw = wfGetDB( DB_MASTER );
152152 $dbw->delete( 'flaggedpage_config',
153153 array( 'fpc_page_id' => $article->getID() ),
154 - __METHOD__ );
155 -
 154+ __METHOD__
 155+ );
156156 return true;
157157 }
158158
@@ -182,7 +182,7 @@
183183 } else {
184184 # Try stable version cache. This should be updated before this is called.
185185 $parserOut = FlaggedRevs::getPageCache( $article );
186 - if( $parserOut==false ) {
 186+ if( $parserOut === false ) {
187187 $text = $sv->getTextForParse();
188188 # Parse the text
189189 $parserOut = FlaggedRevs::parseStableText( $article, $text, $sv->getRevId() );
@@ -619,7 +619,7 @@
620620 # See if there is a stable version. Also, see if, given the page
621621 # config and URL params, the page can be overriden.
622622 $flaggedArticle = FlaggedArticle::getTitleInstance( $title );
623 - if( $wgTitle && $wgTitle->equals( $title ) ) {
 623+ if( !empty($wgTitle) && $wgTitle->equals( $title ) ) {
624624 // Cache stable version while we are at it.
625625 if( $flaggedArticle->pageOverride() && $flaggedArticle->getStableRev() ) {
626626 $result = true;
@@ -1056,7 +1056,7 @@
10571057 * @param string $t timestamp of the log entry
10581058 * @return bool true
10591059 */
1060 - public static function reviewLogLine( $type = '', $action = '', $title = null, $paramArray = array(), &$c = '', &$r = '' ) {
 1060+ public static function reviewLogLine( $type='', $action='', $title=null, $paramArray=array(), &$c='', &$r='' ) {
10611061 $actionsValid = array('approve','approve2','approve-a','approve2-a','unapprove','unapprove2');
10621062 # Show link to page with oldid=x
10631063 if( $type == 'review' && in_array($action,$actionsValid) && is_object($title) && isset($paramArray[0]) ) {
@@ -1243,7 +1243,7 @@
12441244
12451245 public static function addBacklogNotice( &$notice ) {
12461246 global $wgUser, $wgTitle, $wgFlaggedRevsBacklog;
1247 - if( !$wgTitle ) {
 1247+ if( !empty($wgTitle) ) {
12481248 return true; // nothing to do here
12491249 }
12501250 $watchlist = SpecialPage::getTitleFor( 'Watchlist' );

Comments

#Comment by P.Copp (talk | contribs)   13:47, 5 January 2009
 	public static function addBacklogNotice( &$notice ) {
 		global $wgUser, $wgTitle, $wgFlaggedRevsBacklog;
-		if( !$wgTitle ) {
+		if( !empty($wgTitle) ) {

Seems like this deactivated the backlog notice completely.

#Comment by P.Copp (talk | contribs)   15:34, 5 January 2009

Aaron fixed it in r45411. Thanks!

Status & tagging log