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..
This commit is contained in:
Eike Rathke
2022-10-12 16:44:22 +02:00
committed by Pierrick Le Gall
parent a87242f9c2
commit 18ad3bf90c
+5 -5
View File
@@ -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);
?>