Permalink
Browse files

MDL-37061 always validate lang when setting session user

This should resolve problems with TinyMCE langs and some unknown MUCH caching issue.
  • Loading branch information...
1 parent f6ca5cf commit 702ac0ce02b3ebcc203237aa9680023a214e2d60 @skodak skodak committed with Sam Hemelryk Dec 9, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/sessionlib.php
View
4 lib/sessionlib.php
@@ -1069,6 +1069,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) {

0 comments on commit 702ac0c

Please sign in to comment.