aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/download/file.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/download/file.php')
-rw-r--r--phpBB/download/file.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/phpBB/download/file.php b/phpBB/download/file.php
index ed33fc0962..cf8aaa03e8 100644
--- a/phpBB/download/file.php
+++ b/phpBB/download/file.php
@@ -509,16 +509,18 @@ function send_file_to_browser($attachment, $upload_dir, $category)
}
}
- if ($size)
- {
- header("Content-Length: $size");
- }
-
// Close the db connection before sending the file
$db->sql_close();
if (!set_modified_headers($attachment['filetime'], $user->browser))
{
+ // Send Content-Length only if set_modified_headers() does not send
+ // status 304 - Not Modified
+ if ($size)
+ {
+ header("Content-Length: $size");
+ }
+
// Try to deliver in chunks
@set_time_limit(0);