Fix the last assignment in conditional, bit of code duplication, as the next isn...
authorSam Reed <reedy@users.mediawiki.org>
Fri, 25 Mar 2011 10:36:07 +0000 (10:36 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Fri, 25 Mar 2011 10:36:07 +0000 (10:36 +0000)
includes/api/ApiQuerySearch.php

index 59d7e9f..df38312 100644 (file)
@@ -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 ) ) {