Skip to content

Commit

Permalink
Merge pull request SimpleMachines#8099 from Sesquipedalian/content-di…
Browse files Browse the repository at this point in the history
…sposition-mobile

Sets Content-Disposition header correctly for mobile browsers
  • Loading branch information
Sesquipedalian committed Feb 13, 2024
2 parents 7f22610 + 44e6d71 commit 83db36f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/ShowAttachments.php
Expand Up @@ -333,7 +333,7 @@ function showAttachment()
$utf8name = $_REQUEST['attach'] . ' - ' . $utf8name;

// On mobile devices, audio and video should be served inline so the browser can play them.
if (isset($_REQUEST['image']) || (isBrowser('is_mobile') && (strpos($file['mime_type'], 'audio/') !== 0 || strpos($file['mime_type'], 'video/') !== 0)))
if (isset($_REQUEST['image']) || (isBrowser('is_mobile') && (strpos($file['mime_type'], 'audio/') === 0 || strpos($file['mime_type'], 'video/') === 0)))
$disposition = 'inline';
else
$disposition = 'attachment';
Expand Down

0 comments on commit 83db36f

Please sign in to comment.