Commit b43f8c57 authored by Richard Mansfield's avatar Richard Mansfield Committed by Gerrit Code Review
Browse files

Merge "Reset the site language immediately after config is loaded (bug #787123)"

parents cd7c4687 9ca6bb55
......@@ -926,7 +926,13 @@ function print_object($mixed) {
function current_language($reset=null) {
global $USER, $CFG, $SESSION;
static $lang;
static $lang, $cfglang;
if (!isset($cfglang) && isset($CFG->lang) && !empty($CFG->lang) && is_null($reset)) {
// This is the first call to current_language after load_config, so ensure the
// language is reset.
$reset = $cfglang = $CFG->lang;
if (!empty($reset)) {
$lang = $reset; // Set the language for this request
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment