Use a cookie which can changed by JavaScript for setlang
Before this change the cookie set by setlang can't changed with JavaScript UI anymore. Change-Id: Iad5fac0ee7de59813370849f22b685073e4cc535
This commit is contained in:
@@ -39,7 +39,13 @@ class ApiULSSetLanguage extends ApiBase {
|
||||
if ( $user->isAnon() ) {
|
||||
if ( $this->getConfig()->get( 'ULSAnonCanChangeLanguage' ) ) {
|
||||
// Anonymous users can change language.
|
||||
$request->response()->setCookie( 'language', $languageCode );
|
||||
// Use a cookie that also can changed by JavaScript.
|
||||
$request->response()->setCookie(
|
||||
'language',
|
||||
$languageCode,
|
||||
0,
|
||||
[ 'httpOnly' => false ]
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user