Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Wrong error upload filesize > filesize in config  (Read 33762 times)

0 Members and 1 Guest are viewing this topic.

altenae

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 254
Wrong error upload filesize > filesize in config
« on: November 10, 2011, 09:26:00 pm »

This issue still excists on all of my three coppermine galleries (1.5.16)

http://forum.coppermine-gallery.net/index.php/topic,61711.0.html

The only thing wrong is the filesize.
In the config 512kb
If I upload 600 kb I would expect to get this error:

if (filesize($uploaded_pic) > ($CONFIG['max_upl_size'] << 10)) {

        @unlink($uploaded_pic);
        cpg_die(ERROR, sprintf($lang_db_input_php['err_imgsize_too_large'], $CONFIG['max_upl_size']), __FILE__, __LINE__);
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Wrong error upload filesize > filesize in config
« Reply #1 on: November 14, 2011, 05:47:46 pm »

I assume this is exactly the same issue like here, so please try that fix and report if it works as expected.
Logged

altenae

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 254
Re: Wrong error upload filesize > filesize in config
« Reply #2 on: November 14, 2011, 07:16:58 pm »

Changed in the db_input.php

if (filesize($uploaded_pic) > ($CONFIG['max_upl_size'] << 10))

into

if (filesize($uploaded_pic) > ($CONFIG['max_upl_size'] * 1024))

The result is the same.
I have put a print statement and it looks like it never comes to this code.
Strange, because the only thing wrong is the filesize which is larger than I have configured in the config.

Edward
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Wrong error upload filesize > filesize in config
« Reply #3 on: November 15, 2011, 11:54:50 am »

Don't forget to add
Code: [Select]
die();after your print statement. I'll also perform some tests asap (which might take some time these days).
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Logged

altenae

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 254
Re: Wrong error upload filesize > filesize in config
« Reply #5 on: November 15, 2011, 06:17:57 pm »

Hi Andre,

The line you are referring to is present in the upload.php ?

If so , I can.t find any line with "name="MAX_FILE_SIZE" in it...

Edward
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15764
Re: Wrong error upload filesize > filesize in config
« Reply #6 on: November 16, 2011, 10:47:02 am »

It's that line in upload.php:
Code: [Select]
array('MAX_FILE_SIZE', $max_file_size, 4),
Logged

altenae

  • Coppermine frequent poster
  • ***
  • Offline Offline
  • Posts: 254
Re: Wrong error upload filesize > filesize in config
« Reply #7 on: November 16, 2011, 03:29:49 pm »

Yep,

Works correct now.
Logged
Pages: [1]   Go Up
 

Page created in 0.015 seconds with 19 queries.