Permalink
Browse files

fixed problem with apostrophe in role names and description when crea…

…ting roles during install and restore MDL-7611
  • Loading branch information...
1 parent dd5f22e commit 69aaada0f51302690fb86b8f5bbc40909c6b90fe skodak committed Nov 20, 2006
Showing with 13 additions and 13 deletions.
  1. +1 −1 backup/restorelib.php
  2. +12 −12 lib/accesslib.php
View
@@ -6047,7 +6047,7 @@ function restore_create_roles($restore, $xmlfile) {
// done finding a unique name
- $newroleid = create_role($roledata->name,$roledata->shortname,'');
+ $newroleid = create_role(addslashes($roledata->name),addslashes($roledata->shortname),'');
$status = backup_putid($restore->backup_unique_code,"role",$oldroleid,
$newroleid); // adding a new id
foreach ($roledata->capabilities as $capability) {
View
@@ -1212,18 +1212,18 @@ function moodle_install_roles() {
/// Create default/legacy roles and capabilities.
/// (1 legacy capability per legacy role at system level).
- $adminrole = create_role(get_string('administrator'), 'admin',
- get_string('administratordescription'), 'moodle/legacy:admin');
- $coursecreatorrole = create_role(get_string('coursecreators'), 'coursecreator',
- get_string('coursecreatorsdescription'), 'moodle/legacy:coursecreator');
- $editteacherrole = create_role(get_string('defaultcourseteacher'), 'editingteacher',
- get_string('defaultcourseteacherdescription'), 'moodle/legacy:editingteacher');
- $noneditteacherrole = create_role(get_string('noneditingteacher'), 'teacher',
- get_string('noneditingteacherdescription'), 'moodle/legacy:teacher');
- $studentrole = create_role(get_string('defaultcoursestudent'), 'student',
- get_string('defaultcoursestudentdescription'), 'moodle/legacy:student');
- $guestrole = create_role(get_string('guest'), 'guest',
- get_string('guestdescription'), 'moodle/legacy:guest');
+ $adminrole = create_role(addslashes(get_string('administrator')), 'admin',
+ addslashes(get_string('administratordescription')), 'moodle/legacy:admin');
+ $coursecreatorrole = create_role(addslashes(get_string('coursecreators')), 'coursecreator',
+ addslashes(get_string('coursecreatorsdescription')), 'moodle/legacy:coursecreator');
+ $editteacherrole = create_role(addslashes(get_string('defaultcourseteacher')), 'editingteacher',
+ addslashes(get_string('defaultcourseteacherdescription')), 'moodle/legacy:editingteacher');
+ $noneditteacherrole = create_role(addslashes(get_string('noneditingteacher')), 'teacher',
+ addslashes(get_string('noneditingteacherdescription')), 'moodle/legacy:teacher');
+ $studentrole = create_role(addslashes(get_string('defaultcoursestudent')), 'student',
+ addslashes(get_string('defaultcoursestudentdescription')), 'moodle/legacy:student');
+ $guestrole = create_role(addslashes(get_string('guest')), 'guest',
+ addslashes(get_string('guestdescription')), 'moodle/legacy:guest');
/// Now is the correct moment to install capabilities - after creation of legacy roles, but before assigning of roles

0 comments on commit 69aaada

Please sign in to comment.