Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

MOre robust handling of the $lang variable

  • Loading branch information...
commit 71ae822c8a55daa6fdc295d7a9da9096b4e19e80 1 parent 575eba2
moodler authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/setup.php
6 lib/setup.php
View
@@ -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";
Please sign in to comment.
Something went wrong with that request. Please try again.