diff --git a/lib/accesslib.php b/lib/accesslib.php index 0d5932a497c..a459e1aa4dd 100755 --- a/lib/accesslib.php +++ b/lib/accesslib.php @@ -2476,7 +2476,7 @@ function get_assignable_roles ($context) { if ($roles = get_records('role', '', '', 'sortorder ASC')) { foreach ($roles as $role) { if (user_can_assign($context, $role->id)) { - $options[$role->id] = $role->name; + $options[$role->id] = strip_tags(format_string($role->name, true)); } } } @@ -2495,7 +2495,7 @@ function get_overridable_roles ($context) { if ($roles = get_records('role', '', '', 'sortorder ASC')) { foreach ($roles as $role) { if (user_can_override($context, $role->id)) { - $options[$role->id] = $role->name; + $options[$role->id] = strip_tags(format_string($role->name, true)); } } } @@ -2798,4 +2798,4 @@ function get_users_from_role_on_context($role, $context) { AND roleid = $role->id"); } -?> \ No newline at end of file +?> diff --git a/lib/weblib.php b/lib/weblib.php index 633d1ef7eff..3e2cbb7423b 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -1424,7 +1424,7 @@ function text_format_name( $key ) { */ function format_string ($string, $striplinks = false, $courseid=NULL ) { - global $CFG, $course; + global $CFG, $COURSE; //We'll use a in-memory cache here to speed up repeated strings static $strcache; @@ -1438,8 +1438,8 @@ function format_string ($string, $striplinks = false, $courseid=NULL ) { } if (empty($courseid)) { - if (!empty($course->id)) { // An ugly hack for better compatibility - $courseid = $course->id; // (copied from format_text) + if (!empty($COURSE->id)) { // An ugly hack for better compatibility + $courseid = $COURSE->id; // (copied from format_text) } }