mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 22:28:51 +00:00
[ticket/9627] Make sure the database record for the filesize is correct.
PHPBB3-9627
This commit is contained in:
parent
9ed36e1e1b
commit
56b0268d1d
1 changed files with 10 additions and 0 deletions
|
@ -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');
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue