Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-14291

Function send_file_to_browser() endlessly overwrites 'filesize' in ATTACHMENTS_TABLE

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Trivial
    • Resolution: Fixed
    • 3.1.6, 3.2.0-dev
    • 3.1.10-RC1
    • Viewing posts
    • None
    • PHP 5.6, MySQL 5.6, Firefox 44

    Description

      This issue relates to the image attachments with thumbnails.

      How to reproduce:
      + open any page containing an attachment thumbnail,
      + open that attachment in its full size in another browser window,
      + refresh that two pages alternately, emulating the activity of several users.
      Filesize will be overwritten every time, from full image size to thumbnail size and vice versa.

      This doesn’t affect viewing/downloading process, but filesize information, displayed on board pages, becomes inconstant and incorrect.

      Possible fix:

      --- includes/functions_download.php
      +++ includes/functions_download.php
      @@ -165,7 +165,7 @@
       	}
       
       	// Make sure the database record for the filesize is correct
      -	if ($size > 0 && $size != $attachment['filesize'])
      +	if ($size > 0 && $size != $attachment['filesize'] && strpos($attachment['physical_filename'], 'thumb_') === false)
       	{
       		// Update database record
       		$sql = 'UPDATE ' . ATTACHMENTS_TABLE . '
      
      

      Attachments

        Activity

          People

            Marc Marc
            Nekstati Nekstati
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: