mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 01:16:44 +02:00
MDL-42547 tool_uploaduser: trim values before uploading users
This commit is contained in:
parent
d214057cad
commit
7ca44a4963
1 changed files with 5 additions and 5 deletions
|
@ -235,10 +235,10 @@ if ($formdata = $mform2->is_cancelled()) {
|
|||
$user->$key['text'] = $value;
|
||||
$user->$key['format'] = FORMAT_MOODLE;
|
||||
} else {
|
||||
$user->$key = $value;
|
||||
$user->$key = trim($value);
|
||||
}
|
||||
} else {
|
||||
$user->$key = $value;
|
||||
$user->$key = trim($value);
|
||||
}
|
||||
|
||||
if (in_array($key, $upt->columns)) {
|
||||
|
@ -966,7 +966,7 @@ if ($formdata = $mform2->is_cancelled()) {
|
|||
$status = null;
|
||||
|
||||
if (isset($user->{'enrolstatus'.$i})) {
|
||||
$enrolstatus = trim($user->{'enrolstatus'.$i});
|
||||
$enrolstatus = $user->{'enrolstatus'.$i};
|
||||
if ($enrolstatus == '') {
|
||||
$status = null;
|
||||
} else if ($enrolstatus === (string)ENROL_USER_ACTIVE) {
|
||||
|
@ -1109,7 +1109,7 @@ while ($linenum <= $previewrows and $fields = $cir->next()) {
|
|||
$rowcols = array();
|
||||
$rowcols['line'] = $linenum;
|
||||
foreach($fields as $key => $field) {
|
||||
$rowcols[$filecolumns[$key]] = s($field);
|
||||
$rowcols[$filecolumns[$key]] = s(trim($field));
|
||||
}
|
||||
$rowcols['status'] = array();
|
||||
|
||||
|
@ -1135,7 +1135,7 @@ while ($linenum <= $previewrows and $fields = $cir->next()) {
|
|||
}
|
||||
|
||||
if (isset($rowcols['city'])) {
|
||||
$rowcols['city'] = trim($rowcols['city']);
|
||||
$rowcols['city'] = $rowcols['city'];
|
||||
}
|
||||
// Check if rowcols have custom profile field with correct data and update error state.
|
||||
$noerror = uu_check_custom_profile_data($rowcols) && $noerror;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue