Now that wfParseUrl() can handle protocol-relative URLs, make wfExpandUrl() work...
authorRoan Kattouw <catrope@users.mediawiki.org>
Wed, 13 Jul 2011 00:03:27 +0000 (00:03 +0000)
committerRoan Kattouw <catrope@users.mediawiki.org>
Wed, 13 Jul 2011 00:03:27 +0000 (00:03 +0000)
includes/GlobalFunctions.php

index 12b1309..8aa13e7 100644 (file)
@@ -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;