From: Timo Tijhof Date: Tue, 15 Sep 2015 20:21:04 +0000 (+0100) Subject: resourceloader: Don't call wfExpandUrl() on load.php urls X-Git-Tag: 1.31.0-rc.0~10014^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=b5e69c4ef621868787db4e6e1c648b594c3b71b4;p=lhc%2Fweb%2Fwiklou.git resourceloader: Don't call wfExpandUrl() on load.php urls wfExpandUrl() should only be used if the url needs to be absolute and/or needs to point to the canonical, internal or default wgServer for the wiki. For meta-data or API responses this can make sense, but for resources loaded by the browser from the current page, there is no added value in expanding these to the default domain. This is causing problems in custom setups such as at Wikimedia, with "zero" and "m" sub domains for which $wgServer points to the canonical domain. Bug: T106966 Bug: T112646 Change-Id: Ie25d3a8f69564319a1b29b5c5904f3d352924a31 --- diff --git a/includes/resourceloader/ResourceLoader.php b/includes/resourceloader/ResourceLoader.php index b8ec63bb29..da74b35280 100644 --- a/includes/resourceloader/ResourceLoader.php +++ b/includes/resourceloader/ResourceLoader.php @@ -1485,7 +1485,7 @@ MESSAGE; $query = self::createLoaderQuery( $context, $extraQuery ); $script = $this->getLoadScript( $source ); - return wfExpandUrl( wfAppendQuery( $script, $query ), PROTO_RELATIVE ); + return wfAppendQuery( $script, $query ); } /** @@ -1513,7 +1513,7 @@ MESSAGE; $only, $printable, $handheld, $extraQuery ); - return wfExpandUrl( wfAppendQuery( $wgLoadScript, $query ), PROTO_RELATIVE ); + return wfAppendQuery( $wgLoadScript, $query ); } /**