Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
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...
commit 7b03292e244b17ae113f6e7497af7b927ab062d1 1 parent 325e266
@skodak skodak authored
Showing with 4 additions and 0 deletions.
  1. +4 −0 lib/sessionlib.php
View
4 lib/sessionlib.php
@@ -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) {
Please sign in to comment.
Something went wrong with that request. Please try again.