diff options
author | Matt Friedman <maf675@gmail.com> | 2014-05-02 14:22:59 -0700 |
---|---|---|
committer | Matt Friedman <maf675@gmail.com> | 2014-05-02 14:22:59 -0700 |
commit | 257ff46659cb2f35514b21a5345dd68b666e6994 (patch) | |
tree | 7da6323f8fd091e9c04f108cb490fa6ac4def0f4 /phpBB/phpbb/user.php | |
parent | 603c3b4629228e529aa0393ecb9e4ff6e012c74a (diff) | |
download | forums-257ff46659cb2f35514b21a5345dd68b666e6994.tar forums-257ff46659cb2f35514b21a5345dd68b666e6994.tar.gz forums-257ff46659cb2f35514b21a5345dd68b666e6994.tar.bz2 forums-257ff46659cb2f35514b21a5345dd68b666e6994.tar.xz forums-257ff46659cb2f35514b21a5345dd68b666e6994.zip |
[ticket/10521] Allow language switching by URL parameter
PHPBB3-10521
Diffstat (limited to 'phpBB/phpbb/user.php')
-rw-r--r-- | phpBB/phpbb/user.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/phpBB/phpbb/user.php b/phpBB/phpbb/user.php index 2f186593ec..f8e473dcad 100644 --- a/phpBB/phpbb/user.php +++ b/phpBB/phpbb/user.php @@ -80,10 +80,18 @@ class user extends \phpbb\session } else { - $change_lang = $request->variable($config['cookie_name'] . '_lang', '', true, \phpbb\request\request_interface::COOKIE); - if ($change_lang) + $lang_override = $request->variable('language', ''); + if ($lang_override) { - $use_lang = basename($change_lang); + $this->set_cookie('lang', $lang_override, 0, false); + } + else + { + $lang_override = $request->variable($config['cookie_name'] . '_lang', '', true, \phpbb\request\request_interface::COOKIE); + } + if ($lang_override) + { + $use_lang = basename($lang_override); $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; } |