$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'] );
} else {
$titles[] = $title;
}
+
+ $result = $matches->next();
}
if ( is_null( $resultPageSet ) ) {