diff options
author | Sam Reed <reedy@users.mediawiki.org> | 2012-02-18 01:07:42 +0000 |
---|---|---|
committer | Sam Reed <reedy@users.mediawiki.org> | 2012-02-18 01:07:42 +0000 |
commit | 560ebfb7216246b4464c39848feab0edd307ccd2 (patch) | |
tree | 38a81999949ed24dd8c1796dd291a28fc47eb16c | |
parent | a5f83ab29075c9f958fcd611a990aa09de422e94 (diff) | |
download | mediawikicore-560ebfb7216246b4464c39848feab0edd307ccd2.tar.gz mediawikicore-560ebfb7216246b4464c39848feab0edd307ccd2.zip |
Fix possibly undefined variables
Move $db further up
Return something on all paths
Notes
Notes:
http://mediawiki.org/wiki/Special:Code/MediaWiki/111811
-rw-r--r-- | includes/FeedUtils.php | 1 | ||||
-rw-r--r-- | includes/UserMailer.php | 5 | ||||
-rw-r--r-- | includes/api/ApiQueryBlocks.php | 4 | ||||
-rw-r--r-- | includes/specials/SpecialActiveusers.php | 2 |
4 files changed, 8 insertions, 4 deletions
diff --git a/includes/FeedUtils.php b/includes/FeedUtils.php index 0e1c8f184202..d280db5b39d7 100644 --- a/includes/FeedUtils.php +++ b/includes/FeedUtils.php @@ -114,6 +114,7 @@ class FeedUtils { # $wgLang->time( $timestamp ) ), # wfMsg( 'currentrev' ) ); + $diffText = ''; // Don't bother generating the diff if we won't be able to show it if ( $wgFeedDiffCutoff > 0 ) { $de = new DifferenceEngine( $title, $oldid, $newid ); diff --git a/includes/UserMailer.php b/includes/UserMailer.php index 0a2c2425f060..0a02e5280a43 100644 --- a/includes/UserMailer.php +++ b/includes/UserMailer.php @@ -115,10 +115,11 @@ class UserMailer { * @return String */ static function arrayToHeaderString( $headers, $endl = "\n" ) { + $strings = array(); foreach( $headers as $name => $value ) { - $string[] = "$name: $value"; + $strings[] = "$name: $value"; } - return implode( $endl, $string ); + return implode( $endl, $strings ); } /** diff --git a/includes/api/ApiQueryBlocks.php b/includes/api/ApiQueryBlocks.php index 3c0d518629ff..824589cd308b 100644 --- a/includes/api/ApiQueryBlocks.php +++ b/includes/api/ApiQueryBlocks.php @@ -77,6 +77,9 @@ class ApiQueryBlocks extends ApiQueryBase { $this->addOption( 'LIMIT', $params['limit'] + 1 ); $this->addTimestampWhereRange( 'ipb_timestamp', $params['dir'], $params['start'], $params['end'] ); + + $db = $this->getDB(); + if ( isset( $params['ids'] ) ) { $this->addWhereFld( 'ipb_id', $params['ids'] ); } @@ -100,7 +103,6 @@ class ApiQueryBlocks extends ApiQueryBase { } $prefix = substr( $lower, 0, 4 ); - $db = $this->getDB(); $this->addWhere( array( 'ipb_range_start' . $db->buildLike( $prefix, $db->anyString() ), "ipb_range_start <= '$lower'", diff --git a/includes/specials/SpecialActiveusers.php b/includes/specials/SpecialActiveusers.php index 617a80269035..8f4a9431ce54 100644 --- a/includes/specials/SpecialActiveusers.php +++ b/includes/specials/SpecialActiveusers.php @@ -129,7 +129,7 @@ class ActiveUsersPager extends UsersPager { $list = array(); foreach( self::getGroups( $row->user_id ) as $group ) { if ( isset( $this->groups[$group] ) ) { - return; + return ''; } $list[] = self::buildGroupLink( $group, $userName ); } |