From: Sam Reed Date: Sun, 20 Jun 2010 18:52:46 +0000 (+0000) Subject: Do ApiQueryAllUsers per r68337 (was using while (true)..) X-Git-Tag: 1.31.0-rc.0~36437 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=53c5e4b942ddd7a726ebfc00e7c696239a93c2a9;p=lhc%2Fweb%2Fwiklou.git Do ApiQueryAllUsers per r68337 (was using while (true)..) --- diff --git a/includes/api/ApiQueryAllUsers.php b/includes/api/ApiQueryAllUsers.php index fcb8ba18d7..b138425c27 100644 --- a/includes/api/ApiQueryAllUsers.php +++ b/includes/api/ApiQueryAllUsers.php @@ -128,9 +128,9 @@ class ApiQueryAllUsers extends ApiQueryBase { // Otherwise, the group of the new row is appended to the last entry. // The setContinue... is more complex because of this, and takes into account the higher sql limit // to make sure all rows that belong to the same user are received. - // - while ( true ) { - $row = $db->fetchObject( $res ); + + $row = $db->fetchObject( $res ); + foreach ( $res as $row ) { $count++; if ( !$row || $lastUser !== $row->user_name ) { @@ -145,11 +145,6 @@ class ApiQueryAllUsers extends ApiQueryBase { } } - // No more rows left - if ( !$row ) { - break; - } - if ( $count > $limit ) { // We've reached the one extra which shows that there are additional pages to be had. Stop here... $this->setContinueEnumParameter( 'from', $this->keyToTitle( $row->user_name ) );