Now the lang menu is working again.
Note: I've used the PARAM_SAFEDIR flag because it's the
only one supporting alpha+digits+underscore. Its name
doesn't seem to be perfect for this. Perhaps we should
create some alias?
/// then use the one from the default language. Otherwise (and this is the
/// majority of cases), use the stored locale specified by admin.
- if (isset($_GET['lang'])) {
+ if ($lang = optional_param('lang', PARAM_SAFEDIR)) {
if (!detect_munged_arguments($lang, 0) and (file_exists($CFG->dataroot .'/lang/'. $lang) or
file_exists($CFG->dirroot .'/lang/'. $lang))) {
$SESSION->lang = $lang;