From b5e69c4ef621868787db4e6e1c648b594c3b71b4 Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Tue, 15 Sep 2015 21:21:04 +0100 Subject: [PATCH] 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 --- includes/resourceloader/ResourceLoader.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 ); } /** -- 2.20.1