From: Sam Reed Date: Fri, 25 Mar 2011 10:36:07 +0000 (+0000) Subject: Fix the last assignment in conditional, bit of code duplication, as the next isn... X-Git-Tag: 1.31.0-rc.0~31198 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=f8e4915b9cfc75955595b6fec6bdcff7a8a6ea08;p=lhc%2Fweb%2Fwiklou.git Fix the last assignment in conditional, bit of code duplication, as the next isn't iterable :( --- diff --git a/includes/api/ApiQuerySearch.php b/includes/api/ApiQuerySearch.php index 59d7e9f1b7..df3831295b 100644 --- a/includes/api/ApiQuerySearch.php +++ b/includes/api/ApiQuerySearch.php @@ -114,7 +114,8 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { $terms = $wgContLang->convertForSearchResult( $matches->termMatches() ); $titles = array(); $count = 0; - while ( $result = $matches->next() ) { + $result = $matches->next(); + while ( $result ) { if ( ++ $count > $limit ) { // We've reached the one extra which shows that there are additional items to be had. Stop here... $this->setContinueEnumParameter( 'offset', $params['offset'] + $params['limit'] ); @@ -179,6 +180,8 @@ class ApiQuerySearch extends ApiQueryGeneratorBase { } else { $titles[] = $title; } + + $result = $matches->next(); } if ( is_null( $resultPageSet ) ) {