Revert "Adding a bunch of hooks from wikiHow into DifferenceEngine"
[lhc/web/wiklou.git] / includes / api / ApiQuerySearch.php
index 80798a1..4377831 100644 (file)
@@ -231,16 +231,15 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                $hasInterwikiResults = false;
                $totalhits = null;
                if ( $interwiki && $resultPageSet === null && $matches->hasInterwikiResults() ) {
-                       foreach ( $matches->getInterwikiResults() as $matches ) {
-                               $matches = $matches->getInterwikiResults();
+                       foreach ( $matches->getInterwikiResults() as $interwikiMatches ) {
                                $hasInterwikiResults = true;
 
                                // Include number of results if requested
                                if ( $resultPageSet === null && isset( $searchInfo['totalhits'] ) ) {
-                                       $totalhits += $matches->getTotalHits();
+                                       $totalhits += $interwikiMatches->getTotalHits();
                                }
 
-                               $result = $matches->next();
+                               $result = $interwikiMatches->next();
                                while ( $result ) {
                                        $title = $result->getTitle();
 
@@ -267,7 +266,7 @@ class ApiQuerySearch extends ApiQueryGeneratorBase {
                                                $titles[] = $title;
                                        }
 
-                                       $result = $matches->next();
+                                       $result = $interwikiMatches->next();
                                }
                        }
                        if ( $totalhits !== null ) {