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 325e266 commit 7b03292e244b17ae113f6e7497af7b927ab062d1 @skodak skodak committed Dec 9, 2012
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/sessionlib.php
View
@@ -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) {

0 comments on commit 7b03292

Please sign in to comment.