cpg 1.4 BUG report: Not reporting actual total filesize cpg 1.4 BUG report: Not reporting actual total filesize
 

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]

Main Menu

cpg 1.4 BUG report: Not reporting actual total filesize

Started by the_todd, June 08, 2005, 05:36:45 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

the_todd

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
$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:
'{$CURRENT_PIC_DATA['filesize']}', '{$CURRENT_PIC_DATA['filesize']
It should be:
'{$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
$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

donnoman

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".