mirror of
https://github.com/moodle/moodle.git
synced 2025-01-31 12:45:04 +01:00
be a bit more forgiving of lang parameter
This commit is contained in:
parent
350b5fb6c8
commit
748390cd30
@ -535,6 +535,9 @@ $CFG->os = PHP_OS;
|
||||
if ($SESSION !== NULL and $lang = optional_param('lang', false, PARAM_SAFEDIR)) {
|
||||
if (file_exists($CFG->dataroot .'/lang/'. $lang) or file_exists($CFG->dirroot .'/lang/'. $lang)) {
|
||||
$SESSION->lang = $lang;
|
||||
} else if (file_exists($CFG->dataroot.'/lang/'.$lang.'_utf8') or
|
||||
file_exists($CFG->dirroot .'/lang/'.$lang.'_utf8')) {
|
||||
$SESSION->lang = $lang.'_utf8';
|
||||
}
|
||||
}
|
||||
unset($lang);
|
||||
|
Loading…
x
Reference in New Issue
Block a user