Commit bbddada8 authored by Nigel McNie's avatar Nigel McNie
Browse files

It's not always the case that $SESSION will exist. Make sure when it doesn't...

It's not always the case that $SESSION will exist. Make sure when it doesn't the current_language() function doesn't blow up.
parent d0e612bc
......@@ -707,10 +707,14 @@ function current_language() {
return $lang;
}
}
$sesslang = $SESSION->get('lang');
if (!empty($sesslang) && $sesslang != 'default') {
return $sesslang;
if (is_a($SESSION, 'Session')) {
$sesslang = $SESSION->get('lang');
if (!empty($sesslang) && $sesslang != 'default') {
return $sesslang;
}
}
if (!empty($CFG->lang)) {
return $CFG->lang;
}
......
Markdown is supported
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