Page MenuHomePhabricator

Commons Vector.js loads WikiMiniAtlas over http when visiting https://commons
Closed, InvalidPublic

Description

Not strictly in the scope of this tracker, I know, but putting this in as a TODO for myself.

On [[commons:MediaWiki:Vector.js]] (and possibly elsewhere), this:

var metaBase = 'http://meta.wikimedia.org';
if ( mw.config.get( 'wgServer' ) == 'https://secure.wikimedia.org' ) {
var metaBase = 'https://secure.wikimedia.org/wikipedia/meta';
}

needs to be changed to just

var metaBase = '//meta.wikimedia.org';

after we deploy HTTPS to meta.


Version: unspecified
Severity: normal

Details

Reference
bz30734

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:56 PM
bzimport added a project: HTTPS.
bzimport set Reference to bz30734.

There is a structure like that that is about as common, a little bit better:

var xBase = 'http://x.wikimedia.org';
if ( mw.config.get( 'wgServer' ).indexOf('https://') === 0 ) {
var xBase = 'https://secure.wikimedia.org/wikipedia/x';
}

Except that this one is subject to the same bug, because wgServer doesn't contain http nor https. Until https is on all wikis, wikis should use protocol-relative where possible and keep these if-statements for wikis that don't yet.

Marking invalid as it's not a Wikimedia issue, but my previous post shows a work-around for wiks without https, and for those that do have https, the following can be used:

var xBase = '//x.wikimedia.org';
mw.loader.load( xBase + '/w/index.php? ......' );

The latter has been applied to http://commons.wikimedia.org/wiki/MediaWiki:Vector.js