X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=includes%2Fsearch%2FSearchExactMatchRescorer.php;h=40cfe3930581ccfde22fd69873dba7b09b770a4a;hb=64b83bdb3afd0ee4f8fc1893a865409c198e601e;hp=0ff628def0e40182248fe45187874e44309ec831;hpb=174f34a86de3162bc673fd3bc6bed815cccf0edc;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/search/SearchExactMatchRescorer.php b/includes/search/SearchExactMatchRescorer.php index 0ff628def0..40cfe39305 100644 --- a/includes/search/SearchExactMatchRescorer.php +++ b/includes/search/SearchExactMatchRescorer.php @@ -41,7 +41,7 @@ class SearchExactMatchRescorer { */ public function rescore( $search, $namespaces, $srchres, $limit ) { // Pick namespace (based on PrefixSearch::defaultSearchBackend) - $ns = in_array( NS_MAIN, $namespaces ) ? NS_MAIN : $namespaces[0]; + $ns = in_array( NS_MAIN, $namespaces ) ? NS_MAIN : reset( $namespaces ); $t = Title::newFromText( $search, $ns ); if ( !$t || !$t->exists() ) { // No exact match so just return the search results @@ -101,7 +101,7 @@ class SearchExactMatchRescorer { * that is a redirect to it. */ private function redirectTargetsToRedirect( $titles ) { - $result = array(); + $result = []; foreach ( $titles as $key => $titleText ) { $title = Title::newFromText( $titleText ); if ( !$title || !$title->isRedirect() ) {