MDL-37061 always validate lang when setting session user

This should resolve problems with TinyMCE langs and some unknown MUCH caching issue.
This commit is contained in:
Petr Škoda 2012-12-09 11:28:36 +01:00
parent 03953061ca
commit 25336547e8

View File

@ -1122,6 +1122,10 @@ function get_moodle_cookie() {
function session_set_user($user) {
$_SESSION['USER'] = $user;
unset($_SESSION['USER']->description); // conserve memory
if (isset($_SESSION['USER']->lang)) {
// Make sure it is a valid lang pack name.
$_SESSION['USER']->lang = clean_param($_SESSION['USER']->lang, PARAM_LANG);
}
sesskey(); // init session key
if (PHPUNIT_TEST) {