From: Sam Reed Date: Sat, 18 Feb 2012 01:07:42 +0000 (+0000) Subject: Fix possibly undefined variables X-Git-Tag: 1.31.0-rc.0~24643 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=560ebfb7216246b4464c39848feab0edd307ccd2;p=lhc%2Fweb%2Fwiklou.git Fix possibly undefined variables Move $db further up Return something on all paths --- diff --git a/includes/FeedUtils.php b/includes/FeedUtils.php index 0e1c8f1842..d280db5b39 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 0a2c2425f0..0a02e5280a 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 3c0d518629..824589cd30 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 617a802690..8f4a9431ce 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 ); }