Remove potential PHP notices when $course is not an object.

This commit is contained in:
gustav_delius 2005-07-01 17:21:52 +00:00
parent 61c2a9f3c5
commit e0c5c5e974

View File

@ -4384,7 +4384,7 @@ function get_string($identifier, $module='', $a=NULL) {
global $course; /// Not a nice hack, but quick
if (empty($CFG->courselang)) {
if (isset($course->lang)) {
if (is_object($course) and isset($course->lang)) {
$CFG->courselang = $course->lang;
}
}