Commit aa0ddd83 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Fixed 651: header should deal with spaces in field names

parent 05b60df9
......@@ -199,7 +199,8 @@ function uploadcsv_validate(Pieform $form, $values) {
// Get the format of the file
if ($i == 1) {
foreach ($line as $potentialkey) {
foreach ($line as &$potentialkey) {
$potentialkey = trim($potentialkey);
if (!in_array($potentialkey, $ALLOWEDKEYS)) {
$form->set_error('file', get_string('uploadcsverrorinvalidfieldname', 'admin', $potentialkey));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment