From 10630cf572c6229f5e91b1a70bbbde8bd7b759dd Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Wed, 13 Jul 2011 00:03:27 +0000 Subject: [PATCH] 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. --- includes/GlobalFunctions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.20.1