MantisBT: master 07c8da02

Author Committer Branch Timestamp Parent
dhx dhx master 2009-10-27 02:02 master ccd99a0e
Affected Issues  0009775: Unable to download attachments with spaces in the filename
 0011075: File downloading - IE vs non-IE filename bugs
Changeset

Fix 0011075: 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.

mod - core/file_api.php Diff File
mod - core/http_api.php Diff File
mod - file_download.php Diff File
mod - print_all_bug_page_word.php Diff File