diff --git a/grade/import/csv/index.php b/grade/import/csv/index.php index 007655bf348..758b97b1c64 100755 --- a/grade/import/csv/index.php +++ b/grade/import/csv/index.php @@ -50,19 +50,16 @@ $currentgroup = groups_get_course_group($course); // sort out delimiter if (isset($CFG->CSV_DELIMITER)) { - $csv_delimiter = '\\' . $CFG->CSV_DELIMITER; - $csv_delimiter2 = $CFG->CSV_DELIMITER; + $csv_delimiter = $CFG->CSV_DELIMITER; if (isset($CFG->CSV_ENCODE)) { $csv_encode = '/\&\#' . $CFG->CSV_ENCODE . '/'; } } else if ($separator == 'tab') { $csv_delimiter = "\t"; - $csv_delimiter2 = ""; $csv_encode = ""; } else { - $csv_delimiter = "\,"; - $csv_delimiter2 = ","; + $csv_delimiter = ","; $csv_encode = '/\&\#44/'; } @@ -91,7 +88,7 @@ if ($id) { if ($importcode = optional_param('importcode', '', PARAM_FILE)) { $filename = $CFG->dataroot.'/temp/gradeimport/cvs/'.$USER->id.'/'.$importcode; $fp = fopen($filename, "r"); - $header = split($csv_delimiter, fgets($fp,GRADE_CSV_LINE_LENGTH), PARAM_RAW); + $header = explode($csv_delimiter, fgets($fp,GRADE_CSV_LINE_LENGTH), PARAM_RAW); } $mform2 = new grade_import_mapping_form(null, array('gradeitems'=>$gradeitems, 'header'=>$header)); @@ -144,7 +141,7 @@ if ($formdata = $mform->get_data()) { } echo ''; while (!feof ($fp) && $numlines <= $formdata->previewrows) { - $lines = split($csv_delimiter, fgets($fp,GRADE_CSV_LINE_LENGTH)); + $lines = explode($csv_delimiter, fgets($fp,GRADE_CSV_LINE_LENGTH)); echo '