From 9488b6f3a46afc3ca06ddf9fbbeacc6a5182c73f Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Fri, 8 Jan 2016 16:57:32 +0800 Subject: [PATCH] MDL-52649 user: Add check for potentially undefined variables --- user/index.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user/index.php b/user/index.php index bb6e79501b0..5836d09f1fd 100644 --- a/user/index.php +++ b/user/index.php @@ -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)); }