SMF icon indicating copy to clipboard operation
SMF copied to clipboard

[2.1]: Wrong Content-Disposition header being set for attachments served to mobile browsers

Open Sesquipedalian opened this issue 1 year ago • 0 comments

Basic Information

Attachments are being served to mobile browsers with a "Content-Disposition: inline" header when they should be served with a "Content-Disposition: attachment" header.

https://www.simplemachines.org/community/index.php?msg=4169626

Steps to reproduce

  1. Attach an XML file to a post.
  2. Attempt to download the attachment using a mobile browser.

Expected result

The XML file is saved as a file.

Actual result

The XML file is opened in a browser window.

Version/Git revision

2.1.4

Database Engine

All

Database Version

No response

PHP Version

No response

Logs

No response

Additional Information

The problem appears to be the !== comparison operators on this line:

https://github.com/SimpleMachines/SMF/blob/7f226101fcecb6cff4f00051ea5b4837ee0741b0/Sources/ShowAttachments.php#L336

They should actually be === operators.

Sesquipedalian avatar Feb 12 '24 18:02 Sesquipedalian