From b582210a4e694be01a349e3d0ea7b9d38227bf5f Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Mon, 2 Jan 2012 14:38:19 +0000 Subject: [PATCH] Revert r107042 (bug 32219, make InstantCommons protocol-relative) and do it properly + release notes. apibase is used for fetching content from the server as well as determining description pages, so should use a full-qualified protocol when the site's in https. --- RELEASE-NOTES-1.19 | 2 ++ includes/Setup.php | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/RELEASE-NOTES-1.19 b/RELEASE-NOTES-1.19 index 32d35a3c72..47a442ae93 100644 --- a/RELEASE-NOTES-1.19 +++ b/RELEASE-NOTES-1.19 @@ -211,6 +211,8 @@ production. language * (bug 33454) ISO-8601 week-based year number (format character 'o') is now calculated correctly with respect to timezone +* (bug 32219) InstantCommons now fetches content from Wikimedia Commons using + HTTPS when the local wiki is served over HTTPS === API changes in 1.19 === * (bug 19838) siprop=interwikimap can now use the interwiki cache. diff --git a/includes/Setup.php b/includes/Setup.php index 724e868b33..87eccb4729 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -192,7 +192,9 @@ if ( $wgUseInstantCommons ) { $wgForeignFileRepos[] = array( 'class' => 'ForeignAPIRepo', 'name' => 'wikimediacommons', - 'apibase' => '//commons.wikimedia.org/w/api.php', + 'apibase' => WebRequest::detectProtocol() === 'https' ? + 'https://commons.wikimedia.org/w/api.php' : + 'http://commons.wikimedia.org/w/api.php', 'hashLevels' => 2, 'fetchDescription' => true, 'descriptionCacheExpiry' => 43200, -- 2.20.1