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

GraphQL uploads break with certain files #7327

Closed
jamesedmonston opened this issue Dec 23, 2020 · 1 comment
Closed

GraphQL uploads break with certain files #7327

jamesedmonston opened this issue Dec 23, 2020 · 1 comment
Assignees
Labels

Comments

@jamesedmonston
Copy link
Contributor

jamesedmonston commented Dec 23, 2020

Description

Hey, I've noticed an issue where certain files types – we're trying .docx, .xls, .xlsx – fail to upload when creating them via a save_*_Asset mutation.

The issue appears to be related to the regex here not validating when the type has periods.

I copied the regex and ran some tests:

application/thisworks validates correctly:
Screenshot 2020-12-23 at 11 25 17

application/this.doesnt.work doesn't validate:
Screenshot 2020-12-23 at 11 25 26

I'm not sure whether simply tweaking the regex will fix it, as I'm unsure how many file extensions FileHelper::getExtensionByMimeType handles.

Steps to reproduce

  1. Try to create an asset via a save_*_Asset mutation, with a base64 encoded string that contains periods in the data section, e.g. data:application/vnd.ms-excel;base64,....

Additional info

  • Craft version: 3.5.17
  • PHP version: 7.3.23
  • Database driver & version: MySQL 5.5.5
  • Plugins & versions: -
@brandonkelly
Copy link
Member

Craft 3.5.18 is out now with a fix for this. Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants