Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Follow-up fixes for MDL-8531 "Groups icons..." -PARAM_ALPHANUM bug.

  • Loading branch information...
commit 8834b12ad2c841852f899b19137bdfe132c2bbf3 1 parent 16b4e5b
nfreear authored
Showing with 12 additions and 7 deletions.
  1. +3 −3 group/group.php
  2. +9 −4 group/grouping.php
View
6 group/group.php
@@ -21,9 +21,9 @@
$newgrouping= optional_param('newgrouping', false, PARAM_INT);
$groupid = optional_param('group', false, PARAM_INT);
-$groupsettings->name = optional_param('name', false, PARAM_ALPHANUM);
-$groupsettings->description= optional_param('description', '', PARAM_ALPHANUM);
-$groupsettings->enrolmentkey= optional_param('enrolmentkey', '', PARAM_ALPHANUM);
+$groupsettings->name = optional_param('name', false, PARAM_TEXT);
+$groupsettings->description= optional_param('description', '', PARAM_TEXT);
+$groupsettings->enrolmentkey= optional_param('enrolmentkey', '', PARAM_TEXT);
$groupsettings->hidepicture= optional_param('hidepicture', true, PARAM_BOOL);
$delete = optional_param('delete', false, PARAM_BOOL);
View
13 group/grouping.php
@@ -17,8 +17,8 @@
$courseid = required_param('courseid', PARAM_INT);
$groupingid = optional_param('grouping', false, PARAM_INT);
-$groupingsettings->name = optional_param('name', PARAM_ALPHANUM);
-$groupingsettings->description= optional_param('description', PARAM_ALPHANUM);
+$groupingsettings->name = optional_param('name', false, PARAM_TEXT);
+$groupingsettings->description= optional_param('description', '', PARAM_TEXT);
$delete = optional_param('delete', false, PARAM_BOOL);
@@ -64,7 +64,7 @@
if ($groupingid) {
$success = (bool)groups_set_grouping_settings($groupingid, $groupingsettings);
}
- else {
+ else { //OK, new group.
$success = (bool)$groupingid = groups_create_grouping($courseid, $groupingsettings);
}
if ($success) {
@@ -135,7 +135,12 @@
?>
<div class="f-item">
-<p><label for="groupingname"><?php print_string('groupingname', 'group'); ?>&nbsp;</label></p>
+<p><label for="groupingname"><?php
+ print_string('groupingname', 'group');
+ if (isset($err['name'])) {
+ echo' ';
+ formerr($err['name']);
+ } ?>&nbsp; </label></p>
<p><input id="groupingname" name="name" type="text" size="40" value="<?php echo $strname; ?>" /></p>
</div>
Please sign in to comment.
Something went wrong with that request. Please try again.