Skip to content
This repository has been archived by the owner on May 26, 2022. It is now read-only.

Content-Disposition header for file download is not properly encoded #878

Closed
larsbonczek opened this issue Mar 22, 2022 · 1 comment · Fixed by #879
Closed

Content-Disposition header for file download is not properly encoded #878

larsbonczek opened this issue Mar 22, 2022 · 1 comment · Fixed by #879

Comments

@larsbonczek
Copy link
Contributor

In src/Spout/Writer/WriterAbstract.php:141 the value for filename and filename* is not properly encoded. rawurlencode should probably be used instead of rawurldecode.

This leads to an error in the Moodle Learning Platform when a file name contains special characters like a comma: MDL-73624.

If I'm reading RFC5987 correctly, only the extended syntax for filename* may use URL-encoding. The regular syntax for filename (defined as quoted-string in RFC2616 seems to describe backslash-encoding. But reality doesn't seem to agree.

According to this comment on StackOverflow, URL-encoding both values should work with most browsers.

larsbonczek added a commit to larsbonczek/spout that referenced this issue Mar 22, 2022
URL-encode file name in Content-Disposition header for file download.

fixes box#878
@Slamdunk
Copy link

Fix merged in openspout/openspout#46 and released in openspout:v3.7.2

adrilo pushed a commit that referenced this issue Mar 26, 2022
URL-encode file name in Content-Disposition header for file download.

fixes #878
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants