Fixing #1284, conflict in headers creation when loading images in body message, "Cannot modify header information - headers already sent"

This commit is contained in:
Pierre-Alain Bandinelli 2017-03-19 15:00:32 +01:00
parent cbc1aa2f4c
commit d52baf4a8c

View file

@ -8663,12 +8663,14 @@ NewThemeLink IncludeCss LoadingDescriptionEsc TemplatesLink LangLink IncludeBack
if ($bDownload || $sLoadedData)
{
\header('Content-Type: '.$sContentTypeOut);
\header('Content-Disposition: '.($bDownload ? 'attachment' : 'inline').'; '.
if (!headers_sent()) {
\header('Content-Type: '.$sContentTypeOut);
\header('Content-Disposition: '.($bDownload ? 'attachment' : 'inline').'; '.
\trim(\MailSo\Base\Utils::EncodeHeaderUtf8AttributeValue('filename', $sFileNameOut)), true);
\header('Accept-Ranges: bytes');
\header('Content-Transfer-Encoding: binary');
\header('Accept-Ranges: bytes');
\header('Content-Transfer-Encoding: binary');
}
if ($bIsRangeRequest && !$sLoadedData)
{