From 18ad3bf90cf1a52a9dc8b2dc5f1af8f7c3eceb47 Mon Sep 17 00:00:00 2001 From: Eike Rathke Date: Wed, 12 Oct 2022 16:44:22 +0200 Subject: [PATCH] Move sending headers before the flush, fixes #1746 There was Warning: Cannot modify header information - headers already sent in action.php on line 228 see https://piwigo.org/forum/viewtopic.php?id=32254 Unclear how headers could had been sent before sending headers, but.. --- action.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/action.php b/action.php index 8e01a518b..6e125f5b3 100644 --- a/action.php +++ b/action.php @@ -216,6 +216,11 @@ if (ini_get('safe_mode') == 0) @set_time_limit(0); } +foreach ($http_headers as $header) +{ + header( $header ); +} + // Without clean and flush there may be some image download problems, or image can be corrupted after download if (ob_get_length() !== FALSE) { @@ -223,11 +228,6 @@ if (ob_get_length() !== FALSE) } flush(); -foreach ($http_headers as $header) -{ - header( $header ); -} - @readfile($file); ?>