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

Function send_file_to_browser() endlessly overwrites 'filesize' in ATTACHMENTS_TABLE

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 3.1.6, 3.2.0-dev
    • Fix Version/s: 3.1.10-RC1
    • Component/s: Viewing posts
    • Labels:
      None
    • Environment:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: