Corrected accidental language-changing because of lang in POST

This commit is contained in:
moodler
2006-09-24 12:07:44 +00:00
parent bf7288a2c0
commit df206ef87f
+1 -1
View File
@@ -532,7 +532,7 @@ $CFG->os = PHP_OS;
/// in the language file. Otherwise, if the admin hasn't specified a locale
/// then use the one from the default language. Otherwise (and this is the
/// majority of cases), use the stored locale specified by admin.
if ($SESSION !== NULL and $lang = optional_param('lang', false, PARAM_SAFEDIR)) {
if ($SESSION !== NULL && isset($_GET['lang']) && ($lang = clean_param($_GET['lang'], 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