Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: cpg 1.4 BUG report: Not reporting actual total filesize  (Read 3218 times)

0 Members and 1 Guest are viewing this topic.

the_todd

  • Contributor
  • Coppermine novice
  • ***
  • Offline Offline
  • Posts: 42
    • JoomBla!
cpg 1.4 BUG report: Not reporting actual total filesize
« on: June 08, 2005, 05:36:45 am »

Coppermine 1.4 isn't reporting the correct total_filesize in include/picmgmt.inc.php   I found the error and have the solution. Seems to be an overlooked typo:
Original Code: about line 130
Code: [Select]
$query = "INSERT INTO {$CONFIG['TABLE_PICTURES']} (pid, aid, filepath, filename, filesize, total_filesize, pwidth, pheight, ctime, owner_id, owner_name, title, caption, keywords, approved, user1, user2, user3, user4, pic_raw_ip, pic_hdr_ip, position) VALUES ('', '{$CURRENT_PIC_DATA['aid']}', '" . addslashes($CURRENT_PIC_DATA['filepath']) . "', '" . addslashes($CURRENT_PIC_DATA['filename']) . "', '{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['pwidth']}', '{$CURRENT_PIC_DATA['pheight']}', '" . time() . "', '{$CURRENT_PIC_DATA['owner_id']}', '{$CURRENT_PIC_DATA['owner_name']}','{$CURRENT_PIC_DATA['title']}', '{$CURRENT_PIC_DATA['caption']}', '{$CURRENT_PIC_DATA['keywords']}', '{$CURRENT_PIC_DATA['approved']}', '{$CURRENT_PIC_DATA['user1']}', '{$CURRENT_PIC_DATA['user2']}', '{$CURRENT_PIC_DATA['user3']}', '{$CURRENT_PIC_DATA['user4']}', '{$CURRENT_PIC_DATA['pic_raw_ip']}', '{$CURRENT_PIC_DATA['pic_hdr_ip']}', '{$CURRENT_PIC_DATA['position']}')";
   
Now Notice This in the line:
Code: [Select]
'{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['filesize']It should be:
Code: [Select]
'{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['total_filesize']
on a side note:, there is so much different in this version I am starting to port my mods over, I haven't looked too hard, but where is the code that is making the $USER_DATA  array , I don't see it being created in init.inc.php anymore. Where did it go? Also I'm having trouble with some SQL queries, what have you done with that, particularly in regard to this query which is giving me errors from picmgmt.inc.php
Code: [Select]
$result = cpg_db_query("SELECT sum(total_filesize) FROM {$CONFIG['TABLE_PICTURES']}, {$CONFIG['TABLE_ALBUMS']} WHERE  {$CONFIG['TABLE_PICTURES']}.aid = {$CONFIG['TABLE_ALBUMS']}.aid AND category = '" . (FIRST_USER_CAT + USER_ID) . "'");
        $record = mysql_fetch_array($result);

Todd
« Last Edit: June 08, 2005, 07:52:48 am by donnoman »
Logged

donnoman

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 1615
  • From donovanbray.com
    • Donovan Bray
Re: cpg 1.4 BUG report: Not reporting actual total filesize
« Reply #1 on: June 08, 2005, 07:52:00 am »

Thanks for catching that Todd.

Fix committed as documented.

FYI, the $USER_DATA array is now populated in the bridge files.

Even if you aren't using a bridge, coppermines native layer is implemented as a "bridge".

Logged
Pages: [1]   Go Up
 

Page created in 0.015 seconds with 20 queries.