MDL-52649 user: Add check for potentially undefined variables

This commit is contained in:
Jun Pataleta 2016-01-08 16:57:32 +08:00
parent ef343c3299
commit 9488b6f3a4

View File

@ -512,12 +512,12 @@ if ($roleid > 0) {
$a->role = $rolenames[$roleid];
$heading = format_string(get_string('xuserswiththerole', 'role', $a));
if ($currentgroup and $group) {
if ($currentgroup and !empty($group)) {
$a->group = $group->name;
$heading .= ' ' . format_string(get_string('ingroup', 'role', $a));
}
if ($accesssince) {
if ($accesssince && !empty($timeoptions[$accesssince])) {
$a->timeperiod = $timeoptions[$accesssince];
$heading .= ' ' . format_string(get_string('inactiveformorethan', 'role', $a));
}