Browse files

MOre robust handling of the $lang variable

  • Loading branch information...
1 parent 575eba2 commit 71ae822c8a55daa6fdc295d7a9da9096b4e19e80 moodler committed Jul 16, 2004
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/setup.php
View
6 lib/setup.php
@@ -218,8 +218,10 @@ class object {};
/// 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";

0 comments on commit 71ae822

Please sign in to comment.