MOre robust handling of the $lang variable

This commit is contained in:
moodler
2004-07-16 13:26:46 +00:00
parent 575eba292a
commit 71ae822c8a
+4 -2
View File
@@ -218,8 +218,10 @@
/// majority of cases), use the stored locale specified by admin.
if (isset($_GET['lang'])) {
$SESSION->lang = $lang;
$SESSION->encoding = get_string('thischarset');
if (!detect_munged_arguments($lang) and file_exists("$CFG->dirroot/lang/$lang")) {
$SESSION->lang = $lang;
$SESSION->encoding = get_string('thischarset');
}
}
if (empty($CFG->lang)) {
$CFG->lang = "en";