Revert r107042 (bug 32219, make InstantCommons protocol-relative) and do it properly...
authorChad Horohoe <demon@users.mediawiki.org>
Mon, 2 Jan 2012 14:38:19 +0000 (14:38 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Mon, 2 Jan 2012 14:38:19 +0000 (14:38 +0000)
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
includes/Setup.php

index 32d35a3..47a442a 100644 (file)
@@ -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.
index 724e868..87eccb4 100644 (file)
@@ -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,