');
/// first, we see if any exact role definition is found
@@ -671,7 +671,7 @@ if ($info->backup_moodle_version < 2006092801) {
$matchrole = $samerole->id;
// if an exact role is found, it does not matter whether this user can assign this role or not,
// this will be presented as a valid option regardless
- $mappableroles[$samerole->id] = $allroles[$samerole->id]->name." (". $allroles[$samerole->id]->shortname.")";
+ $mappableroles[$samerole->id] = format_string($allroles[$samerole->id]->name)." (". $allroles[$samerole->id]->shortname.")";
} else {
// no exact role found, let's try to match shortname
// this is useful in situations where basic roles differ slightly in definition
@@ -712,9 +712,9 @@ echo (''); // end of role mappings table
/**
* Look for a role in the database with exactly the same definition as the one in the backup file.
- *
+ *
* @param integer $roleid the id that the role in the backup files had on the old server.
- * @param object $role the rest of the definition of the role from the backup file.
+ * @param object $role the rest of the definition of the role from the backup file.
*/
function restore_samerole($roleid, $rolefromxml) {
global $CFG;
@@ -724,13 +724,13 @@ function restore_samerole($roleid, $rolefromxml) {
// First guess, try let's use the id
if (restore_is_samerole($roleid, $rolefromxml)) {
- return get_record('role', 'id', $roleid);
+ return get_record('role', 'id', $roleid);
}
// Second guess, try the shortname
$testroleid = get_field('role', 'id', 'shortname', $rolefromxml->shortname);
if ($testroleid && restore_is_samerole($testroleid, $rolefromxml)) {
- return get_record('role', 'id', $testroleid);
+ return get_record('role', 'id', $testroleid);
}
// Finally, search all other roles. In orter to speed things up, we exclude the ones we have
@@ -765,7 +765,7 @@ function restore_samerole($roleid, $rolefromxml) {
*/
function restore_is_samerole($testroleid, $rolefromxml) {
// Load the role definition from the databse.
- $rolefromdb = get_records('role_capabilities', 'roleid', $testroleid, '', 'capability,permission');
+ $rolefromdb = get_records('role_capabilities', 'roleid', $testroleid, '', 'capability,permission');
if (!$rolefromdb) {
return false;
}
diff --git a/lib/accesslib.php b/lib/accesslib.php
index f5f7032a1ef..1a5143ecf96 100755
--- a/lib/accesslib.php
+++ b/lib/accesslib.php
@@ -5212,7 +5212,7 @@ function role_fix_names($roleoptions, $context, $rolenamedisplay=ROLENAME_ALIAS)
}
}
foreach ($roleoptions as $rid => $name) {
- $roleoptions[$rid] = strip_tags($name);
+ $roleoptions[$rid] = strip_tags(format_string($name));
}
return $roleoptions;
}