From: Roan Kattouw Date: Fri, 19 Aug 2011 15:56:59 +0000 (+0000) Subject: Use wfParseUrl() instead of parse_url() in interwiki search code: the latter can... X-Git-Tag: 1.31.0-rc.0~28167 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=92ff782a999dd4cc7701845df14fd841f65b3964;p=lhc%2Fweb%2Fwiklou.git Use wfParseUrl() instead of parse_url() in interwiki search code: the latter can throw PHP warnings and is totally broken for protocol-relative URLs. Also remove the last usage in core of key_exists(), a deprecated alias for array_key_exists() --- diff --git a/includes/specials/SpecialSearch.php b/includes/specials/SpecialSearch.php index 4da63dec38..8fd6cb3c99 100644 --- a/includes/specials/SpecialSearch.php +++ b/includes/specials/SpecialSearch.php @@ -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)