From: Ricordisamoa Date: Tue, 15 Mar 2016 15:53:05 +0000 (+0100) Subject: mediawiki.api: Log warning when requesting legacy token types X-Git-Tag: 1.31.0-rc.0~7297^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=65077ede90a6b800f4c5bd9e7adcfa3969b12fd7;p=lhc%2Fweb%2Fwiklou.git mediawiki.api: Log warning when requesting legacy token types Change-Id: Ia2c795a95b58f62f4687501a5537e5890d90144e --- diff --git a/resources/src/mediawiki/api.js b/resources/src/mediawiki/api.js index 64e5976c5c..3bc0ad3813 100644 --- a/resources/src/mediawiki/api.js +++ b/resources/src/mediawiki/api.js @@ -39,7 +39,12 @@ 'import', 'options' ]; - return $.inArray( action, csrfActions ) !== -1 ? 'csrf' : action; + if ( $.inArray( action, csrfActions ) !== -1 ) { + mw.track( 'mw.deprecate', 'apitoken_' + action ); + mw.log.warn( 'Use of the "' + action + '" token is deprecated. Use "csrf" instead.' ); + return 'csrf'; + } + return action; } // Pre-populate with fake ajax promises to save http requests for tokens