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

Add text/plain mime type to csv importer #22209

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
3 participants
@kloon
Copy link
Member

commented Dec 13, 2018

All Submissions:

Changes proposed in this Pull Request:

Since WP 5.0.1 there is now strict mime type checking, however csv files have in most cases text/plain mime types and not text/csv. This PR adds text/plain as an acceptable mime type for csv imports.

This is a workaround for the WP 5.0.1 bug. See https://core.trac.wordpress.org/ticket/45615

Closes #22208

How to test the changes in this Pull Request:

  1. Try uploading the sample product file, it should work without issues.

Other information:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Changelog entry

Update - Allow text/plain mime type for CSV uploads.

@kloon kloon added this to the 3.5.3 milestone Dec 13, 2018

@maheshwaghmare

This comment has been minimized.

Copy link

commented Dec 14, 2018

'csv' => 'text/csv',
'csv' => 'text/plain',

Is this 'csv' => 'text/plain' does not override the 'csv' => 'text/csv'? I have same issue with XML so, I have used 'xml' => 'text/xml' instead of 'application/xml' and it works as expected.

@maheshwaghmare

This comment has been minimized.

Copy link

commented Dec 14, 2018

Need to remove the 'csv' => 'text/csv'. I have tested it by adding 'csv' => 'text/plain' and remoing the 'csv' => 'text/csv' and it works as expected.

@mikejolley

This comment has been minimized.

Copy link
Member

commented Jan 7, 2019

Indeed, that would cause a regression and break regular CSV files. Please revise @kloon

@mikejolley

This comment has been minimized.

Copy link
Member

commented Jan 9, 2019

The fix for this is in WordPress 5.0.3 which will drop before our next fix release https://make.wordpress.org/core/2019/01/07/wordpress-5-0-3-release-candidate/

We can leave this workaround out.

@mikejolley mikejolley closed this Jan 9, 2019

@mikejolley mikejolley removed this from the 3.5.4 milestone Jan 16, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.