Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSV Uploader fails due to line ended with "\r\n" #1181

Closed
efolibebe opened this issue Aug 1, 2013 · 1 comment
Closed

CSV Uploader fails due to line ended with "\r\n" #1181

efolibebe opened this issue Aug 1, 2013 · 1 comment

Comments

@efolibebe
Copy link

Hi,

I setup a bunch of reports to upload using Notepad++
and the import failed.

After going through the CSVImporter.php,
I find out that all \r are replaced with \n

Line 89
// Replace carriage return character
$replacedata = preg_replace("/\r/","\n",$data);

As my lines end with \r\n, the modified data get \n\n at the end.

Removing the \r in my file, upload work perfectly.

Thx

@rjmackay
Copy link
Contributor

rjmackay commented Aug 3, 2013

I think this is fixed in the latest code so should be fixed when 2.8 is released: https://github.com/ushahidi/Ushahidi_Web/blob/develop/application/libraries/CSVImporter.php#L89

@rjmackay rjmackay closed this as completed Aug 3, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants