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

Mantis 19934 - Parse CSV by CSV standard - rfc4180 #593

Merged
merged 1 commit into from Oct 7, 2019

Conversation

@bramley
Copy link
Contributor

bramley commented Sep 24, 2019

Description

Use fgetcsv() to parse an import file. Instigated by discussion on another pull request #585

New class to encapsulate reading a csv file. It uses fgetcsv() to read line by line instead of loading the complete file into an array. This is to reduce the memory usage but requires the file to be parsed twice in order to count the number of rows.

Similar changes to admin/import2.php and admin/actions/import2.php to use the new class.
Remove references to the $email_list variable.
Remove the current manipulation of the various line endings.
Use htmlspecialchars() instead of addslashes()

Some phpunit tests.

Related Issue

https://mantis.phplist.org/view.php?id=19934

Screenshots (if appropriate):

@bramley bramley changed the title Parse CSV by CSV standard - rfc4180 Mantis 19934 - Parse CSV by CSV standard - rfc4180 Sep 24, 2019
@samtuke samtuke requested a review from suelaP Sep 24, 2019
@bramley bramley force-pushed the bramley:Mantis_19934 branch from b47d51e to 62fa916 Sep 28, 2019
@suelaP
suelaP approved these changes Oct 7, 2019
@samtuke samtuke merged commit 2032f21 into phpList:master Oct 7, 2019
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.