X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=blobdiff_plain;f=resources%2Fsrc%2Fmediawiki%2Fapi.js;h=b4639ab427c395667d5599c058f885bf4e447308;hb=93aafce974bce277a5c167e1f08348bb636c026c;hp=5abd2d4fa9f515481a3aa669888b0623853eedb8;hpb=e92ea2ef79957faf518f07b65fadd86131814051;p=lhc%2Fweb%2Fwiklou.git diff --git a/resources/src/mediawiki/api.js b/resources/src/mediawiki/api.js index 5abd2d4fa9..b4639ab427 100644 --- a/resources/src/mediawiki/api.js +++ b/resources/src/mediawiki/api.js @@ -51,7 +51,7 @@ } // Pre-populate with fake ajax promises to save http requests for tokens - // we already have on the page via the user.tokens module (bug 34733). + // we already have on the page via the user.tokens module (T36733). promises[ defaultOptions.ajax.url ] = {}; $.each( mw.user.tokens.get(), function ( key, value ) { // This requires #getToken to use the same key as user.tokens. @@ -150,6 +150,9 @@ /** * Massage parameters from the nice format we accept into a format suitable for the API. * + * NOTE: A value of undefined/null in an array will be represented by Array#join() + * as the empty string. Should we filter silently? Warn? Leave as-is? + * * @private * @param {Object} parameters (modified in-place) * @param {boolean} useUS Whether to use U+001F when joining multi-valued parameters. @@ -159,7 +162,7 @@ // Handle common MediaWiki API idioms for passing parameters for ( key in parameters ) { // Multiple values are pipe-separated - if ( $.isArray( parameters[ key ] ) ) { + if ( Array.isArray( parameters[ key ] ) ) { if ( !useUS || parameters[ key ].join( '' ).indexOf( '|' ) === -1 ) { parameters[ key ] = parameters[ key ].join( '|' ); } else { @@ -486,7 +489,7 @@ 'stashwrongowner', 'stashnosuchfilekey' ]; - mw.log.deprecate( mw.Api, 'errors', mw.Api.errors, 'mw.Api.errors' ); + mw.log.deprecate( mw.Api, 'errors', mw.Api.errors, null, 'mw.Api.errors' ); /** * @static @@ -498,6 +501,6 @@ 'duplicate', 'exists' ]; - mw.log.deprecate( mw.Api, 'warnings', mw.Api.warnings, 'mw.Api.warnings' ); + mw.log.deprecate( mw.Api, 'warnings', mw.Api.warnings, null, 'mw.Api.warnings' ); }( mediaWiki, jQuery ) );