From d52baf4a8cb13a4aeca2f42ad34ddc56172f2fcd Mon Sep 17 00:00:00 2001 From: Pierre-Alain Bandinelli Date: Sun, 19 Mar 2017 15:00:32 +0100 Subject: [PATCH] Fixing #1284, conflict in headers creation when loading images in body message, "Cannot modify header information - headers already sent" --- rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php index 2b5c33058..2e2cb3c75 100644 --- a/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php +++ b/rainloop/v/0.0.0/app/libraries/RainLoop/Actions.php @@ -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) {