Use wfParseUrl() instead of parse_url() in interwiki search code: the latter can...
authorRoan Kattouw <catrope@users.mediawiki.org>
Fri, 19 Aug 2011 15:56:59 +0000 (15:56 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Fri, 19 Aug 2011 15:56:59 +0000 (15:56 +0000)
includes/specials/SpecialSearch.php

index 4da63de..8fd6cb3 100644 (file)
@@ -775,13 +775,13 @@ class SpecialSearch extends SpecialPage {
                $out = "";
                // display project name
                if(is_null($lastInterwiki) || $lastInterwiki != $t->getInterwiki()) {
-                       if( key_exists($t->getInterwiki(),$customCaptions) ) {
+                       if( array_key_exists($t->getInterwiki(),$customCaptions) ) {
                                // captions from 'search-interwiki-custom'
                                $caption = $customCaptions[$t->getInterwiki()];
                        } else {
                                // default is to show the hostname of the other wiki which might suck
                                // if there are many wikis on one hostname
-                               $parsed = parse_url($t->getFullURL());
+                               $parsed = wfParseUrl( $t->getFullURL() );
                                $caption = wfMsg('search-interwiki-default', $parsed['host']);
                        }
                        // "more results" link (special page stuff could be localized, but we might not know target lang)