Merge branch 'w49_MDL-37061_m25_invalidlang' of git://github.com/skodak/moodle
authorSam Hemelryk <sam@moodle.com>
Tue, 11 Dec 2012 01:44:08 +0000 (14:44 +1300)
committerSam Hemelryk <sam@moodle.com>
Tue, 11 Dec 2012 01:44:08 +0000 (14:44 +1300)
lib/sessionlib.php

index 123c70e..2fb6f32 100644 (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) {