From: Roan Kattouw Date: Wed, 13 Jul 2011 00:03:27 +0000 (+0000) Subject: Now that wfParseUrl() can handle protocol-relative URLs, make wfExpandUrl() work... X-Git-Tag: 1.31.0-rc.0~28888 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=10630cf572c6229f5e91b1a70bbbde8bd7b759dd;p=lhc%2Fweb%2Fwiklou.git Now that wfParseUrl() can handle protocol-relative URLs, make wfExpandUrl() work in cases where it's fed a protocol-relative URL and $wgServer is also protocol-relative. --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 12b130913a..8aa13e7494 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -437,7 +437,7 @@ function wfExpandUrl( $url ) { global $wgServer; if( substr( $url, 0, 2 ) == '//' ) { $bits = wfParseUrl( $wgServer ); - $scheme = $bits ? $bits['scheme'] : 'http'; + $scheme = $bits && $bits['scheme'] !== '' ? $bits['scheme'] : 'http'; return $scheme . ':' . $url; } elseif( substr( $url, 0, 1 ) == '/' ) { return $wgServer . $url;