mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 22:10:45 +02:00
Merge remote-tracking branch 'github-vse/ticket/12254' into develop-ascraeus
* github-vse/ticket/12254: [ticket/12254] Add subsilver2 support for cookie storage instead of SID [ticket/12254] Use a cookie instead of SID to store language selection [ticket/12254] No longer need to add change_lang to the URL params [ticket/12254] Use 'language' instead of 'set_lang' as the variable name [ticket/12254] Persist set_lang after reg only if changed from default [ticket/12254] Add set_lang var changes to subsilver2 files [ticket/12254] Use new set_lang var to avoid conflict with change_lang [ticket/12254] Stop using deprecated request_var in user class [ticket/12254] Better language switching on registration page
This commit is contained in:
@@ -69,7 +69,7 @@ class user extends \phpbb\session
|
||||
*/
|
||||
function setup($lang_set = false, $style_id = false)
|
||||
{
|
||||
global $db, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache;
|
||||
global $db, $request, $template, $config, $auth, $phpEx, $phpbb_root_path, $cache;
|
||||
global $phpbb_dispatcher;
|
||||
|
||||
if ($this->data['user_id'] != ANONYMOUS)
|
||||
@@ -80,7 +80,17 @@ class user extends \phpbb\session
|
||||
}
|
||||
else
|
||||
{
|
||||
$user_lang_name = basename($config['default_lang']);
|
||||
$change_lang = $request->variable($config['cookie_name'] . '_lang', '', true, \phpbb\request\request_interface::COOKIE);
|
||||
if ($change_lang)
|
||||
{
|
||||
$use_lang = basename($change_lang);
|
||||
$user_lang_name = (file_exists($this->lang_path . $use_lang . "/common.$phpEx")) ? $use_lang : basename($config['default_lang']);
|
||||
$this->data['user_lang'] = $user_lang_name;
|
||||
}
|
||||
else
|
||||
{
|
||||
$user_lang_name = basename($config['default_lang']);
|
||||
}
|
||||
$user_date_format = $config['default_dateformat'];
|
||||
$user_timezone = $config['board_timezone'];
|
||||
|
||||
@@ -190,7 +200,7 @@ class user extends \phpbb\session
|
||||
}
|
||||
unset($lang_set_ext);
|
||||
|
||||
$style_request = request_var('style', 0);
|
||||
$style_request = $request->variable('style', 0);
|
||||
if ($style_request && (!$config['override_user_style'] || $auth->acl_get('a_styles')) && !defined('ADMIN_START'))
|
||||
{
|
||||
global $SID, $_EXTRA_URL;
|
||||
|
Reference in New Issue
Block a user