diff options
author | Andreas Fischer <bantu@phpbb.com> | 2010-06-23 15:38:24 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2010-10-23 18:04:16 +0200 |
commit | 56b0268d1de0575018fd542b9d1b9b71b88c1057 (patch) | |
tree | 2664d4ea57aa6393fed4adb80c1925d678e18272 /phpBB/includes/functions_download.php | |
parent | 9ed36e1e1bd79b4633c1930b09952426cf172850 (diff) | |
download | forums-56b0268d1de0575018fd542b9d1b9b71b88c1057.tar forums-56b0268d1de0575018fd542b9d1b9b71b88c1057.tar.gz forums-56b0268d1de0575018fd542b9d1b9b71b88c1057.tar.bz2 forums-56b0268d1de0575018fd542b9d1b9b71b88c1057.tar.xz forums-56b0268d1de0575018fd542b9d1b9b71b88c1057.zip |
[ticket/9627] Make sure the database record for the filesize is correct.
PHPBB3-9627
Diffstat (limited to 'phpBB/includes/functions_download.php')
-rw-r--r-- | phpBB/includes/functions_download.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/phpBB/includes/functions_download.php b/phpBB/includes/functions_download.php index 6d52e92e7c..606d6eec32 100644 --- a/phpBB/includes/functions_download.php +++ b/phpBB/includes/functions_download.php @@ -157,6 +157,16 @@ function send_file_to_browser($attachment, $upload_dir, $category) trigger_error('UNABLE_TO_DELIVER_FILE'); } + // Make sure the database record for the filesize is correct + if ($size > 0 && $size != $attachment['filesize']) + { + // Update database record + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' + SET filesize = ' . (int) $size . ' + WHERE attach_id = ' . (int) $attachment['attach_id']; + $db->sql_query($sql); + } + // Now the tricky part... let's dance header('Pragma: public'); |