Do not use setlang to change user language

Requests using GET should only retrieve data and should have no other effect.
(https://en.wikipedia.org/wiki/HTTP_GET_request)

* Use API with POST to change the user interface language in user settings.
* When allowed by wgULSAnonCanChangeLanguage set cookie for anonymous user
  or when API fails.

This change uses mediawiki.cookie which requires MediaWiki 1.24+.

Bug: T46649
Change-Id: Iaf6fafbf200933dfc760be69d2adf5e5efcf8245
This commit is contained in:
Fomafix
2015-09-08 20:21:05 +00:00
committed by [[mw:User:Fomafix]]
parent c6d5599ad8
commit 0d5c69f655
2 changed files with 32 additions and 8 deletions

View File

@@ -70,7 +70,8 @@ $wgResourceModules['ext.uls.init'] = array(
'monobook' => 'resources/css/ext.uls-monobook.css',
),
'dependencies' => array(
'mediawiki.Uri',
'mediawiki.api',
'mediawiki.cookie',
'jquery.client',
'jquery.cookie',
),