r111811 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111810‎ | r111811 | r111812 >
Date:01:07, 18 February 2012
Author:reedy
Status:ok
Tags:
Comment:
Fix possibly undefined variables

Move $db further up

Return something on all paths
Modified paths:
  • /trunk/phase3/includes/FeedUtils.php (modified) (history)
  • /trunk/phase3/includes/UserMailer.php (modified) (history)
  • /trunk/phase3/includes/api/ApiQueryBlocks.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialActiveusers.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/FeedUtils.php
@@ -114,6 +114,7 @@
115115 # $wgLang->time( $timestamp ) ),
116116 # wfMsg( 'currentrev' ) );
117117
 118+ $diffText = '';
118119 // Don't bother generating the diff if we won't be able to show it
119120 if ( $wgFeedDiffCutoff > 0 ) {
120121 $de = new DifferenceEngine( $title, $oldid, $newid );
Index: trunk/phase3/includes/UserMailer.php
@@ -115,10 +115,11 @@
116116 * @return String
117117 */
118118 static function arrayToHeaderString( $headers, $endl = "\n" ) {
 119+ $strings = array();
119120 foreach( $headers as $name => $value ) {
120 - $string[] = "$name: $value";
 121+ $strings[] = "$name: $value";
121122 }
122 - return implode( $endl, $string );
 123+ return implode( $endl, $strings );
123124 }
124125
125126 /**
Index: trunk/phase3/includes/api/ApiQueryBlocks.php
@@ -77,6 +77,9 @@
7878
7979 $this->addOption( 'LIMIT', $params['limit'] + 1 );
8080 $this->addTimestampWhereRange( 'ipb_timestamp', $params['dir'], $params['start'], $params['end'] );
 81+
 82+ $db = $this->getDB();
 83+
8184 if ( isset( $params['ids'] ) ) {
8285 $this->addWhereFld( 'ipb_id', $params['ids'] );
8386 }
@@ -100,7 +103,6 @@
101104 }
102105 $prefix = substr( $lower, 0, 4 );
103106
104 - $db = $this->getDB();
105107 $this->addWhere( array(
106108 'ipb_range_start' . $db->buildLike( $prefix, $db->anyString() ),
107109 "ipb_range_start <= '$lower'",
Index: trunk/phase3/includes/specials/SpecialActiveusers.php
@@ -129,7 +129,7 @@
130130 $list = array();
131131 foreach( self::getGroups( $row->user_id ) as $group ) {
132132 if ( isset( $this->groups[$group] ) ) {
133 - return;
 133+ return '';
134134 }
135135 $list[] = self::buildGroupLink( $group, $userName );
136136 }

Sign-offs

UserFlagDate
Nikerabbitinspected09:46, 18 February 2012

Status & tagging log