mirror of
https://github.com/moodle/moodle.git
synced 2025-01-17 13:38:32 +01:00
MDL-73138 group: remove double encoding of group/role names.
This commit is contained in:
parent
16c5835a80
commit
017f8a9c4d
@ -95,7 +95,7 @@ switch ($action) {
|
||||
|
||||
foreach($groupmemberroles as $roleid=>$roledata) {
|
||||
$shortroledata = new stdClass();
|
||||
$shortroledata->name = $roledata->name;
|
||||
$shortroledata->name = html_entity_decode($roledata->name, ENT_QUOTES, 'UTF-8');
|
||||
$shortroledata->users = array();
|
||||
foreach($roledata->users as $member) {
|
||||
$shortmember = new stdClass();
|
||||
@ -183,7 +183,7 @@ if ($groups) {
|
||||
foreach ($groups as $group) {
|
||||
$selected = false;
|
||||
$usercount = $DB->count_records('groups_members', array('groupid' => $group->id));
|
||||
$groupname = format_string($group->name) . ' (' . $usercount . ')';
|
||||
$groupname = format_string($group->name, true, ['context' => $context, 'escape' => false]) . ' (' . $usercount . ')';
|
||||
if (in_array($group->id, $groupids)) {
|
||||
$selected = true;
|
||||
if ($singlegroup) {
|
||||
@ -234,8 +234,9 @@ if ($singlegroup) {
|
||||
|
||||
$users[] = $shortmember;
|
||||
}
|
||||
|
||||
$members[] = (object)[
|
||||
'role' => s($roledata->name),
|
||||
'role' => html_entity_decode($roledata->name, ENT_QUOTES, 'UTF-8'),
|
||||
'rolemembers' => $users
|
||||
];
|
||||
}
|
||||
|
@ -763,11 +763,11 @@ abstract class groups_user_selector_base extends user_selector_base {
|
||||
foreach ($roles as $role) {
|
||||
if ($search) {
|
||||
$a = new stdClass;
|
||||
$a->role = $role->name;
|
||||
$a->role = html_entity_decode($role->name, ENT_QUOTES, 'UTF-8');
|
||||
$a->search = $search;
|
||||
$groupname = get_string('matchingsearchandrole', '', $a);
|
||||
} else {
|
||||
$groupname = $role->name;
|
||||
$groupname = html_entity_decode($role->name, ENT_QUOTES, 'UTF-8');
|
||||
}
|
||||
$groupedusers[$groupname] = $role->users;
|
||||
foreach ($groupedusers[$groupname] as &$user) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user