mirror of
https://github.com/moodle/moodle.git
synced 2025-04-22 00:42:54 +02:00
MDL-46792 core_group: Check that $data->name is set before trimming
Signed-off-by: Tony Butler <tonyjbutler@gmail.com>
This commit is contained in:
parent
e1eb180806
commit
f84b9e65e4
@ -375,7 +375,9 @@ function groups_update_group($data, $editform = false, $editoroptions = false) {
|
||||
$context = context_course::instance($data->courseid);
|
||||
|
||||
$data->timemodified = time();
|
||||
$data->name = trim($data->name);
|
||||
if (isset($data->name)) {
|
||||
$data->name = trim($data->name);
|
||||
}
|
||||
if (isset($data->idnumber)) {
|
||||
$data->idnumber = trim($data->idnumber);
|
||||
if (($existing = groups_get_group_by_idnumber($data->courseid, $data->idnumber)) && $existing->id != $data->id) {
|
||||
@ -420,7 +422,9 @@ function groups_update_group($data, $editform = false, $editoroptions = false) {
|
||||
function groups_update_grouping($data, $editoroptions=null) {
|
||||
global $DB;
|
||||
$data->timemodified = time();
|
||||
$data->name = trim($data->name);
|
||||
if (isset($data->name)) {
|
||||
$data->name = trim($data->name);
|
||||
}
|
||||
if (isset($data->idnumber)) {
|
||||
$data->idnumber = trim($data->idnumber);
|
||||
if (($existing = groups_get_grouping_by_idnumber($data->courseid, $data->idnumber)) && $existing->id != $data->id) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user