mirror of
https://github.com/moodle/moodle.git
synced 2025-03-19 23:20:09 +01:00
MDL-79350 core: Do not store lang in session when readonly
This commit is contained in:
parent
0a09e482e4
commit
ce1f9ec96a
@ -10210,8 +10210,14 @@ function setup_lang_from_browser() {
|
||||
// Clean it properly for include.
|
||||
$lang = strtolower(clean_param($lang, PARAM_SAFEDIR));
|
||||
if (get_string_manager()->translation_exists($lang, false)) {
|
||||
// Lang exists, set it in session.
|
||||
$SESSION->lang = $lang;
|
||||
// If the translation for this language exists then try to set it
|
||||
// for the rest of the session, if this is a read only session then
|
||||
// we can only set it temporarily in $CFG.
|
||||
if (defined('READ_ONLY_SESSION') && !empty($CFG->enable_read_only_sessions)) {
|
||||
$CFG->lang = $lang;
|
||||
} else {
|
||||
$SESSION->lang = $lang;
|
||||
}
|
||||
// We have finished. Go out.
|
||||
break;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user