From 65077ede90a6b800f4c5bd9e7adcfa3969b12fd7 Mon Sep 17 00:00:00 2001 From: Ricordisamoa Date: Tue, 15 Mar 2016 16:53:05 +0100 Subject: [PATCH] mediawiki.api: Log warning when requesting legacy token types Change-Id: Ia2c795a95b58f62f4687501a5537e5890d90144e --- resources/src/mediawiki/api.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 -- 2.20.1