From f8e4915b9cfc75955595b6fec6bdcff7a8a6ea08 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Fri, 25 Mar 2011 10:36:07 +0000 Subject: [PATCH] Fix the last assignment in conditional, bit of code duplication, as the next isn't iterable :( --- includes/api/ApiQuerySearch.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 ) ) { -- 2.20.1