Skip to content
Snippets Groups Projects
Commit 53725d27 authored by Jared Hancock's avatar Jared Hancock
Browse files

Handle Macintosh style line endings for CSV import

parent bba9ccce
No related branches found
No related tags found
No related merge requests found
......@@ -456,6 +456,8 @@ class User extends UserModel {
function importFromPost($stuff, $extra=array()) {
if (is_array($stuff) && !$stuff['error']) {
// Properly detect Macintosh style line endings
ini_set('auto_detect_line_endings', true);
$stream = fopen($stuff['tmp_name'], 'r');
}
elseif ($stuff) {
......
......@@ -31,6 +31,9 @@ class UserManager extends Module {
switch ($args['action']) {
case 'import':
// Properly detect Macintosh style line endings
ini_set('auto_detect_line_endings', true);
if (!$options['file'])
$this->fail('CSV file to import users from is required!');
elseif (!($this->stream = fopen($options['file'], 'rb')))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment