[ticket/9627] Make sure the database record for the filesize is correct.

PHPBB3-9627
This commit is contained in:
Andreas Fischer 2010-06-23 15:38:24 +02:00
parent 9ed36e1e1b
commit 56b0268d1d

View file

@ -157,6 +157,16 @@ function send_file_to_browser($attachment, $upload_dir, $category)
trigger_error('UNABLE_TO_DELIVER_FILE'); 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 // Now the tricky part... let's dance
header('Pragma: public'); header('Pragma: public');