Skip to content
Snippets Groups Projects
Commit 9cc0a62d authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #1139 from greezybacon/issue/csv-import-line-endings


Handle Macintosh style line endings for CSV import

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents 19970aa6 53725d27
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