MDL-67024 Lib: Check if user->mnethostid is set before using it

This commit is contained in:
Farhan Karmali
2020-03-20 11:59:45 +05:30
parent 46fe2c5533
commit 98ae29ae24
+2 -1
View File
@@ -1609,7 +1609,8 @@ class moodle_page {
}
$mnetpeertheme = '';
if (isloggedin() and isset($CFG->mnet_localhost_id) and $USER->mnethostid != $CFG->mnet_localhost_id) {
$mnetvarsok = isset($CFG->mnet_localhost_id) && isset($USER->mnethostid);
if (isloggedin() and $mnetvarsok and $USER->mnethostid != $CFG->mnet_localhost_id) {
require_once($CFG->dirroot.'/mnet/peer.php');
$mnetpeer = new mnet_peer();
$mnetpeer->set_id($USER->mnethostid);