Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #11075: Add Content-Disposition workaround for Internet Explorer/…
…Chrome Internet Explorer and Chrome don't support RFC2231 and also ignore the fallback method currently implemented in MantisBT. See http://greenbytes.de/tech/tc2231/#attfnboth2 for the current method. We can however use another method to display UTF8 filenames to IE and Chrome. This workaround is actually in breach in RFC2231. See http://greenbytes.de/tech/tc2231/#attwithfnrawpctenclong for details. We use this method when the user agent is determined to be IE or Chrome. Otherwise we just keep using the original RFC2231 fallback technique mentioned above. It also appears that urlencode() is the wrong method to use for encoding filenames. Browsers seem to expect %20 as a space instead of +. Thus we should use rawurlencode() instead for the old method of encoding URLs. RFC2231 actually contains examples with %20 being used. Some minor cleanups were also performed in relation to sending the Content-Disposition header and also performing browser checks.
- Loading branch information
1 parent
ccd99a0
commit 07c8da0
Showing
4 changed files
with
79 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters