Do not try to save options for anonymous user

This change requires 65062d3c from core included in MediaWiki 1.20+.

Change-Id: I130ab8e93107e066d2cb757c511c844e161b703f
This commit is contained in:
Fomafix 2015-11-28 23:10:40 +00:00 committed by [[mw:User:Fomafix]]
parent d0ef64af5d
commit 2278f87b89

View file

@ -294,6 +294,10 @@
},
setCodeEditorPreference: function ( prefValue ) {
var api = new mw.Api();
// Do not try to save options for anonymous user
if ( mw.user.isAnon() ) {
return;
}
api.postWithToken( 'options', {
action: 'options',
optionname: 'usecodeeditor',