Skip to content
Snippets Groups Projects
Commit 56ae0abe authored by Владислав Яковлев's avatar Владислав Яковлев
Browse files

#52 Fix upload students

parent 9702f8d8
Branches
Tags
No related merge requests found
...@@ -9,15 +9,10 @@ class FileParser ...@@ -9,15 +9,10 @@ class FileParser
* @return array errors * @return array errors
*/ */
public static function uploadStudents($filename, $facultyID) { public static function uploadStudents($filename, $facultyID) {
if (File::mime($filename) != 'text/plain') $content = explode("\r\n", self::toUTF8(file_get_contents($filename)));
return [];
$file = file_get_contents($filename);
$content = explode("\r\n", self::toUTF8($file)); // DO NOT REPLACE " BY ' THERE!
$i = 0; $i = 0;
$errors = []; $errors = [];
foreach ($content as $line) { foreach ($content as $line) {
$line = explode(';', $line); $line = explode(';', $line);
$line = Arr::map('trim', $line); $line = Arr::map('trim', $line);
......
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