MDL-64959 uploaduser: remove leading/trailing spaces from CSV headings
Earlier while uploading users via CSV, if any leading or trailing space was there in headings of CSV file then error was displayed which will be difficult for a non-technical person to understand. After this patch, leading and trailing spaces from headings will be trimmed automatically.
This commit is contained in:
@@ -183,6 +183,7 @@ function uu_validate_user_upload_columns(csv_import_reader $cir, $stdfields, $pr
|
||||
$processed = array();
|
||||
foreach ($columns as $key=>$unused) {
|
||||
$field = $columns[$key];
|
||||
$field = trim($field);
|
||||
$lcfield = core_text::strtolower($field);
|
||||
if (in_array($field, $stdfields) or in_array($lcfield, $stdfields)) {
|
||||
// standard fields are only lowercase
|
||||
|
||||
Reference in New Issue
Block a user